All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-ppc-devel@lists.xensource.com,
	Isaku Yamahata <yamahata@valinux.co.jp>,
	xen-devel <xen-devel@lists.xensource.com>,
	Keir Fraser <keir@xensource.com>,
	xen-ia64-devel@lists.xensource.com
Subject: Re: [XenPPC] Re: [PATCH] [GNTTAB] expandable grant table
Date: Mon, 26 Feb 2007 18:05:18 -0600	[thread overview]
Message-ID: <1172534718.910.43.camel@basalt> (raw)
In-Reply-To: <C2092024.2B66%Keir.Fraser@cl.cam.ac.uk>

On Mon, 2007-02-26 at 23:39 +0000, Keir Fraser wrote:
> On 26/2/07 23:31, "Hollis Blanchard" <hollisb@us.ibm.com> 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.

OK, I see x86's XENMAPSPACE_grant_table handler; the locking makes sense
there.

> 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.

I don't believe that's a concern, since updating
grant_table->nr_grant_frames is the very last step in
gnttab_grow_table(), and it will only grow.

The comments about locking around nr_grant_frames() and
nr_grant_entries() are confusing at best, since you don't need a lock to
read an integer...

-- 
Hollis Blanchard
IBM Linux Technology Center

  reply	other threads:[~2007-02-27  0:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <eab087540611141441s4fbe89b8k48e062c51730932a@mail.gmail.com>
2007-01-05 13:43 ` [PATCH] [GNTTAB] expandable grant table Keir Fraser
2007-01-06  6:48   ` Isaku Yamahata
2007-02-15 14:39     ` Keir Fraser
2007-02-15 15:38       ` Isaku Yamahata
2007-02-19  8:03       ` Isaku Yamahata
2007-02-26 23:31         ` Re: [Xen-devel] " Hollis Blanchard
2007-02-26 23:39           ` [XenPPC] " Keir Fraser
2007-02-27  0:05             ` Hollis Blanchard [this message]
2007-02-27  7:50               ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1172534718.910.43.camel@basalt \
    --to=hollisb@us.ibm.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-ia64-devel@lists.xensource.com \
    --cc=xen-ppc-devel@lists.xensource.com \
    --cc=yamahata@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.