From: Hollis Blanchard <hollisb@us.ibm.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: xen-ppc-devel@lists.xensource.com, xen-devel@lists.xensource.com,
xen-ia64-devel@lists.xensource.com
Subject: Re: [XenPPC] [PATCH 1/4] xencomm take 2: xen side varisous fixes and preparation for consolidation
Date: Mon, 13 Aug 2007 15:08:58 -0500 [thread overview]
Message-ID: <1187035738.31317.21.camel@basalt> (raw)
In-Reply-To: <20070813035910.GA20100%yamahata@valinux.co.jp>
On Mon, 2007-08-13 at 12:59 +0900, Isaku Yamahata wrote:
> - Xencomm should get_page()/put_page() after address conversion from paddr
> to maddr because xen supports SMP and balloon driver.
> Otherwise another vcpu may free the page at the same time.
> Such a domain behaviour doesn't make sense, however nothing prevents it.
Unfortunately my test system is currently down, so I can't test this
today.
However, one initial comment: I really dislike the way get/put_page()
are scattered through this code. Maybe every pair is balanced today, but
it will be difficult to maintain, and especially to test all the error
paths.
I think this needs a more symmetrical API. Right now get_page() and
put_page() are being done at multiple levels, and in
xencomm_get_address() we're calling put_page() only to call get_page() a
moment later in xencomm_paddr_to_vaddr(). I don't have a concrete
proposal for simplifying this.
Also, it looks like we're calling put_page() on the 'desc' page itself
before we're done with it, so that's a bug.
> +static int
> +xencomm_paddr_to_vaddr(unsigned long paddr, unsigned long *vaddr,
> + struct page_info **page)
Since we can use page_to_vaddr(), I don't think you need to pass 'vaddr'
here. That should simplify the code a little bit.
By the way, this looks bogus:
>
> +static int
> +xencomm_get_address(const void *handle, struct xencomm_desc *desc,
> int i,
> + unsigned long **address, struct page_info **page)
> +{
> + if (i == 0)
> + *address = &desc->address[0];
> + else
> + (*address)++;
Shouldn't that be *address = &desc->address[i] ?
I definitely agree that some of these fixes are needed (especially
checking for the descriptor page overlap, and using get/put_page()).
However, this code is difficult to follow already, and these patches are
confusing *me* (and I wrote it! :) so I'm very nervous about increasing
the complexity.
Since the only issue you've identified is populate_physmap, and that has
an easy workaround, I would prefer the easier solution.
--
Hollis Blanchard
IBM Linux Technology Center
next prev parent reply other threads:[~2007-08-13 20:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-13 3:59 [PATCH 1/4] xencomm take 2: xen side varisous fixes and preparation for consolidation Isaku Yamahata
2007-08-13 20:08 ` Hollis Blanchard [this message]
2007-08-14 1:39 ` Re: [XenPPC] " Isaku Yamahata
2007-08-15 13:50 ` [Xen-devel] " Hollis Blanchard
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=1187035738.31317.21.camel@basalt \
--to=hollisb@us.ibm.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.