Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Oleg Nesterov
On 08/01, Paul E. McKenney wrote: > > On Fri, Aug 01, 2014 at 05:53:10PM +0200, Oleg Nesterov wrote: > > On 07/30, Paul E. McKenney wrote: > > > > > > + rcu_read_lock(); > > > + for_each_process_thread(g, t) { > > > + if (t != current && ACCESS_ONCE(t->on_rq) && > >

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Paul E. McKenney
On Fri, Aug 01, 2014 at 05:53:10PM +0200, Oleg Nesterov wrote: > On 07/30, 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))

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Oleg Nesterov
On 07/30, 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)) { > + t->rcu_tasks_nvcsw =

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Oleg Nesterov
On 07/30, 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)) { + t-rcu_tasks_nvcsw = ACCESS_ONCE(t-nvcsw);

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Paul E. McKenney
On Fri, Aug 01, 2014 at 05:53:10PM +0200, Oleg Nesterov wrote: On 07/30, 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)) { +

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-08-01 Thread Oleg Nesterov
On 08/01, Paul E. McKenney wrote: On Fri, Aug 01, 2014 at 05:53:10PM +0200, Oleg Nesterov wrote: On 07/30, Paul E. McKenney wrote: + rcu_read_lock(); + for_each_process_thread(g, t) { + if (t != current ACCESS_ONCE(t-on_rq) +

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Fri, Aug 01, 2014 at 08:53:38AM +0800, Lai Jiangshan wrote: > On 08/01/2014 12:09 AM, Paul E. McKenney wrote: > > > > >>> + /* > >>> + * There were callbacks, so we need to wait for an > >>> + * RCU-tasks grace period. Start off by scanning > >>> + * the

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Lai Jiangshan
On 08/01/2014 12:09 AM, Paul E. McKenney wrote: > >>> + /* >>> +* There were callbacks, so we need to wait for an >>> +* RCU-tasks grace period. Start off by scanning >>> +* the task list for tasks that are not already >>> +* voluntarily

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 07:27:52PM +0200, Oleg Nesterov wrote: > On 07/31, Paul E. McKenney wrote: > > > > On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: > > > > > But can't we avoid get_task_struct()? This can pin a lot of task_struct's. > > > Can't we just add

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Oleg Nesterov
On 07/31, Paul E. McKenney wrote: > > On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: > > > But can't we avoid get_task_struct()? This can pin a lot of task_struct's. > > Can't we just add list_del_rcu(holdout_list) into __unhash_process() ? > > If I add the list_del_rcu() there,

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: > Again, sorry, I didn't read the patches yet, just noticed your discussion... > > On 07/31, Paul E. McKenney wrote: > > > > On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: > > > > > > +

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Peter Zijlstra
On Thu, Jul 31, 2014 at 09:47:39AM -0700, Paul E. McKenney wrote: > The idea here is to avoid having the kthread and to avoid providing > callbacks, but to instead do the work currently done by the kthread > in a synchronous function called by the updater? yep. > My concern with this approach

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 06:20:30PM +0200, Peter Zijlstra wrote: > On Thu, Jul 31, 2014 at 09:09:24AM -0700, Paul E. McKenney wrote: > > Well, that is one of the questions in the 0/10 cover letter. If it turns > > out to be necessary to worry about idle-task trampolines, it should be > > possible

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Oleg Nesterov
Again, sorry, I didn't read the patches yet, just noticed your discussion... On 07/31, Paul E. McKenney wrote: > > On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: > > > > + t->rcu_tasks_nvcsw = ACCESS_ONCE(t->nvcsw); > > > +

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Peter Zijlstra
On Thu, Jul 31, 2014 at 09:09:24AM -0700, Paul E. McKenney wrote: > Well, that is one of the questions in the 0/10 cover letter. If it turns > out to be necessary to worry about idle-task trampolines, it should be > possible to avoid hammering all idle CPUs in the common case. Though maybe >

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: > On 07/31/2014 08:39 AM, Paul E. McKenney wrote: > > From: "Paul E. McKenney" > > > > This commit adds a new RCU-tasks flavor of RCU, which provides > > call_rcu_tasks(). This RCU flavor's quiescent states are voluntary > > context

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Lai Jiangshan
On 07/31/2014 08:39 AM, Paul E. McKenney wrote: > From: "Paul E. McKenney" > > This commit adds a new RCU-tasks flavor of RCU, which provides > call_rcu_tasks(). This RCU flavor's quiescent states are voluntary > context switch (not preemption!), userspace execution, and the idle loop. > Note

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Lai Jiangshan
On 07/31/2014 08:39 AM, Paul E. McKenney wrote: From: Paul E. McKenney paul...@linux.vnet.ibm.com This commit adds a new RCU-tasks flavor of RCU, which provides call_rcu_tasks(). This RCU flavor's quiescent states are voluntary context switch (not preemption!), userspace execution, and the

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: On 07/31/2014 08:39 AM, Paul E. McKenney wrote: From: Paul E. McKenney paul...@linux.vnet.ibm.com This commit adds a new RCU-tasks flavor of RCU, which provides call_rcu_tasks(). This RCU flavor's quiescent states are

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Peter Zijlstra
On Thu, Jul 31, 2014 at 09:09:24AM -0700, Paul E. McKenney wrote: Well, that is one of the questions in the 0/10 cover letter. If it turns out to be necessary to worry about idle-task trampolines, it should be possible to avoid hammering all idle CPUs in the common case. Though maybe

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Oleg Nesterov
Again, sorry, I didn't read the patches yet, just noticed your discussion... On 07/31, Paul E. McKenney wrote: On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: + t-rcu_tasks_nvcsw = ACCESS_ONCE(t-nvcsw); + t-rcu_tasks_holdout

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 06:20:30PM +0200, Peter Zijlstra wrote: On Thu, Jul 31, 2014 at 09:09:24AM -0700, Paul E. McKenney wrote: Well, that is one of the questions in the 0/10 cover letter. If it turns out to be necessary to worry about idle-task trampolines, it should be possible to

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Peter Zijlstra
On Thu, Jul 31, 2014 at 09:47:39AM -0700, Paul E. McKenney wrote: The idea here is to avoid having the kthread and to avoid providing callbacks, but to instead do the work currently done by the kthread in a synchronous function called by the updater? yep. My concern with this approach is

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: Again, sorry, I didn't read the patches yet, just noticed your discussion... On 07/31, Paul E. McKenney wrote: On Thu, Jul 31, 2014 at 03:30:12PM +0800, Lai Jiangshan wrote: +

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Oleg Nesterov
On 07/31, Paul E. McKenney wrote: On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: But can't we avoid get_task_struct()? This can pin a lot of task_struct's. Can't we just add list_del_rcu(holdout_list) into __unhash_process() ? If I add the list_del_rcu() there, then I am

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Thu, Jul 31, 2014 at 07:27:52PM +0200, Oleg Nesterov wrote: On 07/31, Paul E. McKenney wrote: On Thu, Jul 31, 2014 at 06:31:38PM +0200, Oleg Nesterov wrote: But can't we avoid get_task_struct()? This can pin a lot of task_struct's. Can't we just add list_del_rcu(holdout_list) into

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Lai Jiangshan
On 08/01/2014 12:09 AM, Paul E. McKenney wrote: + /* +* There were callbacks, so we need to wait for an +* RCU-tasks grace period. Start off by scanning +* the task list for tasks that are not already +* voluntarily blocked. Mark

Re: [PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-31 Thread Paul E. McKenney
On Fri, Aug 01, 2014 at 08:53:38AM +0800, Lai Jiangshan wrote: On 08/01/2014 12:09 AM, Paul E. McKenney wrote: + /* + * There were callbacks, so we need to wait for an + * RCU-tasks grace period. Start off by scanning + * the task list for tasks

[PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-30 Thread Paul E. McKenney
From: "Paul E. McKenney" This commit adds a new RCU-tasks flavor of RCU, which provides call_rcu_tasks(). This RCU flavor's quiescent states are voluntary context switch (not preemption!), userspace execution, and the idle loop. Note that unlike other RCU flavors, these quiescent states occur

[PATCH v2 tip/core/rcu 01/10] rcu: Add call_rcu_tasks()

2014-07-30 Thread Paul E. McKenney
From: Paul E. McKenney paul...@linux.vnet.ibm.com This commit adds a new RCU-tasks flavor of RCU, which provides call_rcu_tasks(). This RCU flavor's quiescent states are voluntary context switch (not preemption!), userspace execution, and the idle loop. Note that unlike other RCU flavors, these