Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618196

Re: [PATCH -v6 04/13] futex,rt_mutex: Provide futex specific rt_mutex API

From Darren Hart <dvhart@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH -v6 04/13] futex,rt_mutex: Provide futex specific rt_mutex API
Date 2017-04-06 19:10 +0200
Message-ID <ttj50-3IL-11@gated-at.bofh.it> (permalink)
References <tnM01-11I-7@gated-at.bofh.it> <tnM03-11I-47@gated-at.bofh.it> <tsUJl-4eA-43@gated-at.bofh.it> <tteyl-8ob-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 06, 2017 at 02:17:28PM +0200, Peter Zijlstra wrote:
> On Wed, Apr 05, 2017 at 08:02:17AM -0700, Darren Hart wrote:
> > > @@ -1364,20 +1364,18 @@ static int wake_futex_pi(u32 __user *uad
> > >  	pi_state->owner = new_owner;
> > >  	raw_spin_unlock(&new_owner->pi_lock);
> > >  
> > >  	/*
> > > +	 * We've updated the uservalue, this unlock cannot fail.
> > 
> > It isn't clear to me what I should understand from this new comment. How does
> > the value of the uval affect whether or not the pi_state->pi_mutex can be
> > unlocked or not? Or are you noting that we've set FUTEX_WAITIERS so any valid
> > userspace operations will be forced intot he kernel and can't race with us since
> > we hold the hb->lock? With futexes, I think it's important that we be very
> > explicit in our comment blocks.
> 
> The critical point is that once you've modified uval we must not fail;
> there is no way to undo things thereafter.

Aha, "must not", OK. I interpretted "cannot" as "is incapable of failing". So
let's use something like that for the comment:

/*
 * We updated the user value and are committed to completing the unlock, we must
 * not fail.
 */

Wow... English. I tried a few versions, but cannot, may not, etc. all have
doublt meanings. :-)

-- 
Darren Hart
VMware Open Source Technology Center

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH -v6 04/13] futex,rt_mutex: Provide futex specific  rt_mutex API Darren Hart <dvhart@infradead.org> - 2017-04-05 17:10 +0200
  Re: [PATCH -v6 04/13] futex,rt_mutex: Provide futex specific  rt_mutex API Peter Zijlstra <peterz@infradead.org> - 2017-04-06 14:20 +0200
    Re: [PATCH -v6 04/13] futex,rt_mutex: Provide futex specific  rt_mutex API Darren Hart <dvhart@infradead.org> - 2017-04-06 19:10 +0200

csiph-web