lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 16 Dec 2010 20:47:54 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Chris Mason <chris.mason@...cle.com>,
	Frank Rowand <frank.rowand@...sony.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Mike Galbraith <efault@....de>, Paul Turner <pjt@...gle.com>,
	Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 5/5] sched: Reduce ttwu rq->lock contention

On Thu, 2010-12-16 at 20:03 +0100, Peter Zijlstra wrote:
> On Thu, 2010-12-16 at 19:58 +0100, Peter Zijlstra wrote:
> > > > +    * Since we've already set TASK_WAKING this task's CPU cannot
> > > > +    * change from under us.
> > > 
> > > I think it can. Yes, we've set TASK_WAKING. But, at least the task
> > > itself can change its state back to TASK_RUNNING without calling
> > > schedule. Say, __wait_event()-like code.
> > 
> > Oh crud, you're right, that's going to make all this cmpxchg stuff lots
> > more interesting :/ 
> 
> Hrmph, we can add a task_is_waking() test to the rq->lock in schedule(),
> like we have for __task_rq_lock():
> 
>   local_irq_save(flags);
> again:
>   while (task_is_waking(current))
> 	cpu_relax();
>   raw_spin_lock(rq->lock);
>   if (task_is_waking(current)) {
> 	raw_spin_unlock(rq->lock);
> 	goto again;
>   }
> 
> 
> But that's not particularly pretty...

OK, I'm just not thinking straight here, if we're not passing through
schedule() the above clearly won't help any...

Damn, that's a nasty case to solve...

  current->state = TASK_UNINTERRUPTIBLE;
  while (!true)
    schedule();
  current->state = TASK_RUNNING;

... /me goes make a strong pot of tea
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ