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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070718163559.GA837@tv-sign.ru>
Date:	Wed, 18 Jul 2007 20:35:59 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Mike Galbraith <efault@....de>, linux-kernel@...r.kernel.org
Subject: Re: Q: a bogus task_running() check in try_to_wake_up() ?

On 07/17, Ingo Molnar wrote:
> 
> * Oleg Nesterov <oleg@...sign.ru> wrote:
> 
> > try_to_wake_up:
> > 	
> > 	if (p->se.on_rq)
> > 		goto out_running;
> > 
> > 	...
> > 
> > 	if (unlikely(task_running(rq, p)))
> > 		goto out_activate;
> > 
> > How it possible that rq->curr has on_rq == 0 ?
> > 
> > AFAICS, this can only happen if this task is rq->idle. But idle 
> > threads should not sleep, we have a special "scheduling from the idle 
> > thread!" check in schedule().
> 
> it's also possible if an arch uses __ARCH_WANT_INTERRUPTS_ON_CTXSW, 
> right?

Ah, got it. I guess you meant __ARCH_WANT_UNLOCKED_CTXSW though.

In that case schedule() drops rq->lock before the context switch, but doesn't
clear ->oncpu. So, task_running(p) means we must not activate "p" on another
CPU, otherwise it could be scheduled before the switch-in-progress completes.

Thanks a lot!

Oleg.

-
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