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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1294144484.2016.135.camel@laptop>
Date:	Tue, 04 Jan 2011 13:34:44 +0100
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Yong Zhang <yong.zhang0@...il.com>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	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>,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 08/17] sched: Drop the rq argument to
 sched_class::select_task_rq()

On Tue, 2011-01-04 at 15:27 +0800, Yong Zhang wrote:
> On Mon, Jan 3, 2011 at 11:49 PM, Oleg Nesterov <oleg@...hat.com> wrote:
> >
> > Ah, sorry for the confusion, I only meant sched_exec() case.
> > set_cpus_allowed_ptr() does need need_migrate_task(), of course.
> >
> >
> > As for set_cpus_allowed_ptr()->need_migrate_task() path, I have another
> > question,
> >
> >        static bool need_migrate_task(struct task_struct *p)
> >        {
> >                /*
> >                 * If the task is not on a runqueue (and not running), then
> >                 * the next wake-up will properly place the task.
> >                 */
> >                smp_rmb(); /* finish_lock_switch() */
> >                return p->on_rq || p->on_cpu;
> >        }
> >
> > I don't understand this smp_rmb(). Yes, finish_lock_switch() does
> > wmb() before it clears ->on_cpu, but how these 2 barriers can pair?
> >
> > In fact, I am completely confused. I do not understand why do we
> > check task_running() at all. If we see on_rq == 0 && on_cpu == 1,
> > then this task is going to clear its on_cpu soon, once it finishes
> > context_switch().
> >
> > Probably, this check was needed before, try_to_wake_up() could
> > activate the task_running() task without migrating. But, at first
> > glance, this is no longer possible after this series?
> 
> Yeah, task_running() is not needed after patch 13 which
> may be the suitable place to poke :)

That and patch 6, which removes the false negatives from ->on_rq.
--
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