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: <20140803133318.GB671@redhat.com>
Date:	Sun, 3 Aug 2014 15:33:18 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...nel.org,
	laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
	josh@...htriplett.org, tglx@...utronix.de, peterz@...radead.org,
	rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
	dvhart@...ux.intel.com, fweisbec@...il.com, bobby.prani@...il.com
Subject: Re: [PATCH v3 tip/core/rcu 1/9] rcu: Add call_rcu_tasks()

On 08/02, Paul E. McKenney wrote:
>
> On Sat, Aug 02, 2014 at 04:56:16PM +0200, Oleg Nesterov wrote:
> > On 07/31, Paul E. McKenney wrote:
> > >
> > > +		rcu_read_lock();
> > > +		for_each_process_thread(g, t) {
> > > +			if (t != current && ACCESS_ONCE(t->on_rq) &&
> > > +			    !is_idle_task(t)) {
> >
> > I didn't notice this check before, but it is not needed. for_each_process()
> > can see the idle threads, there are not on process/thread lists.
    ^^^^^^^

argh, I mean't "can't see" of course...

> Good to know.  Any other important tasks I am missing?

Nothing else.

> I am guessing that I need to do something like this:
>
> 	for_each_process(g) {
> 		/* Do build step. */
> 		for_each_thread(g, t) {
> 			if (g == t)
> 				continue;
> 			/* Do build step. */
> 		}
> 	}

Sorry, I don't understand... This is equivalent to

	for_each_process_thread(g, t) {
		/* Do build step. */
	}

> Your point about exiting tasks I get, and I believe I can solve it.
> I am hoping that the above sort of construction takes care of the
> idle threads.

It is simple to find the idle threads, just

	for_each_cpu(cpu) {
		do_something(cpu_rq(cpu)->idle);
	}

but it is not clear to me what else you need to do with the idle threads.
Probably not too much, they mostly run under preempt_disable().

> I might also need to do something to handle changes in
> process/thread hierarchy -- but hopefully without having to read-acquire
> the task-list lock.

It seems that you need another global list, a task should be visible on that
list until exit_rcu().

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