[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140730170442.GA29577@redhat.com>
Date: Wed, 30 Jul 2014 19:04:42 +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 RFC tip/core/rcu 8/9] rcu: Make RCU-tasks track exiting
tasks
On 07/28, Paul E. McKenney wrote:
>
> This commit adds synchronization with exiting tasks, so that RCU-tasks
> avoids waiting on tasks that no longer exist.
I don't understand this patch yet, but it seems that it adds more than
just synchronization with exiting tasks?
> + ACCESS_ONCE(t->rcu_tasks_holdout) = 1;
> + spin_unlock(&t->rcu_tasks_lock);
> + smp_mb(); /* Order ->rcu_tasks_holdout store before "if". */
> + if (t == current || !ACCESS_ONCE(t->on_rq) || is_idle_task(t)) {
> + smp_store_release(&t->rcu_tasks_holdout, 0);
> + goto next_thread;
> + }
This should avoid the race with schedule()->rcu_note_voluntary_context_switch(),
right?
> - rcu_read_lock();
> - do_each_thread(g, t) {
> - if (t != current && ACCESS_ONCE(t->on_rq) &&
> - !is_idle_task(t)) {
> - t->rcu_tasks_holdout = 1;
Because before this patch the code looks obviously racy, a task can do
sleep(FOREVER) and block rcu_tasks_kthread() if it reads ->on_rq == 1
after rcu_note_voluntary_context_switch() was already called.
However, I am not sure this race is actually closed even after this
change... why rcu_note_voluntary_context_switch() can not miss
->rcu_tasks_holdout != 0 ?
OK, it seems that you are going to send the next version anyway, so
please ignore.
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