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

[Xen-ia64-devel] Re: [XenPPC] Re: [Xen-devel] [PATCH] [GNTTAB] expandabl

To: Hollis Blanchard <hollisb@xxxxxxxxxx>, Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] Re: [XenPPC] Re: [Xen-devel] [PATCH] [GNTTAB] expandable grant table
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Mon, 26 Feb 2007 23:39:16 +0000
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 26 Feb 2007 15:38:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1172532668.910.34.camel@basalt>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdZ/1PAkjXisMXyEdu1nwAWy6hiGQ==
Thread-topic: [XenPPC] Re: [Xen-devel] [PATCH] [GNTTAB] expandable grant table
User-agent: Microsoft-Entourage/11.3.3.061214
On 26/2/07 23:31, "Hollis Blanchard" <hollisb@xxxxxxxxxx> wrote:

> 
> Hi Yamahata-san, thanks very much for your patch!
> 
> I'm confused about one thing though: why do we need to take a lock to
> read d->grant_table->nr_grant_frames? It's a simple integer, so no lock
> is required or useful.

I haven't got the ppc code immediately to hand but the x86 code will
dynamically grow the grant table based on requests made via the
add_to_physmap hypercall, hence it needs to take the lock. I see ia64 takes
it also even though it only reads from nr_grant_frames (it won;t dynamically
expand via the add_to_physmap hypercall). That's possibly overkill although
there is some concern over reading nr_grant_frames versus looking up a
grant-table page that appears within the range [0, nr_grant_frames-1] which
taking the lock trivially sidesteps. If ia64 didn't take the lock it might
be possible to see an increased value of nr_grant_frames that the expand
function hadn't yet fully installed the new grant-table pages for yet.

 -- Keir



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