From: "Siddha, Suresh B" Subject: Re: [Patch] by default don't give all memory to dom0 Date: Thu, 18 Aug 2005 17:13:19 -0700 Message-ID: <20050818171319.B19322@unix-os.sc.intel.com> References: <20050818122413.C17270@unix-os.sc.intel.com> <4304E6A1.7090800@blueyonder.co.uk> <20050818132826.A19322@unix-os.sc.intel.com> <430503E9.8040200@blueyonder.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <430503E9.8040200@blueyonder.co.uk>; from david.nospam.hopwood@blueyonder.co.uk on Thu, Aug 18, 2005 at 10:55:53PM +0100 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: David Hopwood Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Aug 18, 2005 at 10:55:53PM +0100, David Hopwood wrote: > Siddha, Suresh B wrote: > > On Thu, Aug 18, 2005 at 08:50:57PM +0100, David Hopwood wrote: > >>Siddha, Suresh B wrote: > >>[...] > >> > >>>+static void parse_reserve_dmamem(char *s) > >>>+{ > >>>+ unsigned long long bytes = parse_size_and_unit(s); > >>>+ /* If no unit is specified we default to kB units, not bytes. */ > >>>+ if ( isdigit(s[strlen(s)-1]) ) > >>>+ reserve_dmapages = (unsigned int)bytes >> (PAGE_SHIFT - 10); > >>>+ else > >>>+ reserve_dmapages = (unsigned int)(bytes >> PAGE_SHIFT); > >>>+} > >> > >>Shouldn't the default unit be consistent for all Xen memory parameters? > > > > I am just following the dom0_mem conventions for which default unit is kB. > > Am I missing something? > > If Kbytes is to be the default unit, then that default should probably be > encoded in 'parse_size_and_unit', rather than having code like the above > convert from bytes to Kbytes in many places. For "mem=" option, default unit is bytes. I think we should go with the linux style and make the default unit as bytes. If no one has any objections, then I can send a patch for it. thanks, suresh