xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v1 7/8]: PVH privcmd changes
Date: Mon, 8 Oct 2012 13:46:54 -0700	[thread overview]
Message-ID: <20121008134654.588b35ac@mantra.us.oracle.com> (raw)
In-Reply-To: <1349724405.6952.53.camel@dagon.hellion.org.uk>

On Mon, 8 Oct 2012 20:26:45 +0100
Ian Campbell <Ian.Campbell@citrix.com> wrote:

> On Mon, 2012-10-08 at 20:10 +0100, Mukesh Rathor wrote:
> > On Mon, 8 Oct 2012 10:21:42 +0100
> > Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > 
> > > On Fri, 2012-10-05 at 22:22 +0100, Mukesh Rathor wrote:
> > > > On Fri, 5 Oct 2012 10:21:18 +0100
> > > > Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > > > 
> > > > > On Thu, 2012-10-04 at 19:20 +0100, Mukesh Rathor wrote:
> > > > > > On Thu, 4 Oct 2012 09:50:42 +0100
> > > >         if (xen_feature(XENFEAT_auto_translated_physmap)) {
> > > >                 int sz = sizeof(vma->vm_private_data);
> > > >                 return (!__cmpxchg(&vma->vm_private_data, NULL,
> > > > NULL, sz));
> > > 
> > > Passing NULL for both old and new values can't be right, can it?
> > > Did you test with something which tries to map twice?
> > 
> > well, if it's already set to pointer, then __cmpxchg would leave
> > the ptr alone and return it. The function would then return false
> > which would fail the api. OTOH, if it's NULL, it would continue and
> > get set later.
> 
> What happens if a second thread tries to create a mapping while the
> first is between the cmpxchg and the assignment? i.e. while the value
> is still NULL.

Ah, right, I forgot multi threaded... 

      reply	other threads:[~2012-10-08 20:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 19:21 [PATCH v1 7/8]: PVH privcmd changes Mukesh Rathor
2012-09-24 14:24 ` Stefano Stabellini
2012-09-25 13:44   ` Ian Campbell
2012-09-26  1:28   ` Mukesh Rathor
2012-09-26 13:13     ` Konrad Rzeszutek Wilk
2012-09-25 13:46 ` Ian Campbell
2012-10-02 10:54 ` Stefano Stabellini
2012-10-03 13:21 ` Ian Campbell
2012-10-03 22:31   ` Mukesh Rathor
2012-10-04  8:50     ` Ian Campbell
2012-10-04 18:20       ` Mukesh Rathor
2012-10-05  9:21         ` Ian Campbell
2012-10-05 17:34           ` Mukesh Rathor
2012-10-05 21:22           ` Mukesh Rathor
2012-10-08  9:21             ` Ian Campbell
2012-10-08 19:10               ` Mukesh Rathor
2012-10-08 19:26                 ` Ian Campbell
2012-10-08 20:46                   ` Mukesh Rathor [this message]

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=20121008134654.588b35ac@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=konrad.wilk@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).