From: "Jan Beulich" Subject: Re: [PATCH v5 1/8] xen: introduce gnttab_max_frames and gnttab_max_maptrack_frames command line options Date: Tue, 14 Oct 2014 11:50:11 +0100 Message-ID: <543D1C03020000780003EAE9@mail.emea.novell.com> References: <1413212324-664-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XdzgH-0001L7-AA for xen-devel@lists.xenproject.org; Tue, 14 Oct 2014 10:50:17 +0000 In-Reply-To: <1413212324-664-1-git-send-email-stefano.stabellini@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel , Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 13.10.14 at 16:58, wrote: > --- a/docs/misc/xen-command-line.markdown > +++ b/docs/misc/xen-command-line.markdown > @@ -611,8 +611,23 @@ Specify the serial parameters for the GDB stub. > ### gnttab\_max\_nr\_frames > > `= ` > > +*Deprecated* > +Use gnttab\_max\_frames and gnttab\_max\_maptrack\_frames instead. > + > +Specify the maximum number of frames per grant table operation and the > +maximum number of maptrack frames domain. > + > +### gnttab\_max\_frames > +> `= ` > + > Specify the maximum number of frames per grant table operation. > > +### gnttab\_max\_maptrack\_frames > +> `= ` > + > +Specify the maximum number of maptrack frames domain. > +The default value is 8 times gnttab_max_nr_frames. > + Please don't break the alphabetical sorting in this file (i.e. the two new options should go ahead of the deprecated old one). I also question this latter new option referencing the deprecated one. > +/* this option is deprecated, use gnttab_max_frames and > + * gnttab_max_maptrack_frames instead */ > +static void __init parse_gnttab_max_nr_frames(const char *s) > +{ > + if ( isdigit(*s) ) > + { > + max_grant_frames = simple_strtoul(s, &s, 0); > + max_maptrack_frames = max_grant_frames * MAX_MAPTRACK_TO_GRANTS_RATIO; > + } > +} > +custom_param("gnttab_max_nr_frames", parse_gnttab_max_nr_frames); Hmm, that's not really how I think (and outlined) this should work. Considering that setting both of the to be controlled variables to zero is meaningless, have _3_ variables each controlled by the respective integer_param() command line option, and each zero initialized. Then in an __initcall() handler (I think that's early enough, but please double check) check which of the two new variables are still zero, and set them according to the deprecated option's value if so. And of course warn if the deprecated option is being used. Jan