WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [Patch] by default don't give all memory to dom0

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [Patch] by default don't give all memory to dom0
From: David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>
Date: Thu, 18 Aug 2005 22:55:53 +0100
Delivery-date: Thu, 18 Aug 2005 21:53:53 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20050818132826.A19322@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20050818122413.C17270@xxxxxxxxxxxxxxxxxxxx> <4304E6A1.7090800@xxxxxxxxxxxxxxxx> <20050818132826.A19322@xxxxxxxxxxxxxxxxxxxx>
Reply-to: david.nospam.hopwood@xxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
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.

--
David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel