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


Groups > linux.kernel > #1709699

Re: linux-next: build failure after merge of the rcu tree

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: linux-next: build failure after merge of the rcu tree
Date 2017-08-11 16:50 +0200
Message-ID <udjqa-4KG-15@gated-at.bofh.it> (permalink)
References <uda3v-7k6-1@gated-at.bofh.it> <udadc-7ng-5@gated-at.bofh.it> <udegN-1FX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 11, 2017 at 11:14:34AM +0200, Peter Zijlstra wrote:
> On Thu, Aug 10, 2017 at 09:54:53PM -0700, Paul E. McKenney wrote:
> > On Fri, Aug 11, 2017 at 02:43:52PM +1000, Stephen Rothwell wrote:
> > 
> > Looks like I need to rebase my patch on top of a9668cd6ee28, and
> > than put an smp_mb__after_spinlock() between the lock and the unlock.
> > 
> > Peter, any objections to that approach?  Other suggestions?
> 
> Hurm.. I'll have to try and understand that comment there again it
> seems.

OK, so per commit b5740f4b2cb3 ("sched: Fix ancient race in do_exit()")
the race is with try_to_wake_up():

down_read()
	p->state = TASK_UNINTERRUPTIBLE;

						try_to_wake_up(p)
							spin_lock(p->pi_lock);
							/* sees TASK_UNINTERRUPTIBLE */
							ttwu_remote()
	/* check stuff, no need to schedule() */
	p->state = TASK_RUNNING


p->state = TASK_DEAD

								p->state = TASK_RUNNING /* whoops! */
							spin_unlock(p->pi_lock);

__schedule(false);
BUG();




So given that, I think that:

  spin_lock(&current->pi_lock);
  spin_unlock(&current->pi_lock);

  current->state = TASK_DEAD;

is sufficient. I don't see a need for an additional smp_mb here.

Either the concurrent ttwu is finished and we must observe its RUNNING
store, or it will observe our RUNNING store.

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


Thread

linux-next: build failure after merge of the rcu tree Stephen Rothwell <sfr@canb.auug.org.au> - 2017-08-11 06:50 +0200
  Re: linux-next: build failure after merge of the rcu tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-08-11 07:00 +0200
    Re: linux-next: build failure after merge of the rcu tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 11:20 +0200
      Re: linux-next: build failure after merge of the rcu tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-08-11 16:40 +0200
        Re: linux-next: build failure after merge of the rcu tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 16:50 +0200
      Re: linux-next: build failure after merge of the rcu tree Peter Zijlstra <peterz@infradead.org> - 2017-08-11 16:50 +0200
        Re: linux-next: build failure after merge of the rcu tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-08-11 22:20 +0200

csiph-web