lkml.org 
[lkml]   [2013]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] hotplug: Optimize cpu_hotplug_{begin,done}() using rcu_sync
On 10/03, Peter Zijlstra wrote:
>
> On Thu, Oct 03, 2013 at 09:48:38AM -0700, Paul E. McKenney wrote:
> > > -enum { readers_fast = 0, readers_slow, readers_block };
> > > +enum { readers_slow, readers_block };
> >
> > It took me a bit to realize that readers_fast is obsoleted by the
> > rcu_sync_is_idle() above. ;-)
>
> Yeah.. I pondered changing/adding to the rcu_sync interface to allow
> using gp_count like status to avoid the extra variable, but decided
> against it for now.

Agreed, it looks simple enough even if get/put has to read ->gp_state
or/and cpuhp_state.

But, just is case, this is one example of why it probably makes sense
to rcu_sync_struct->state_changed(new_state, void *data) callback. In
this case it could simply do

static void cpuhp_rcu_sync_state_cb(state, ...)
{
switch (state) {
case GP_IDLE:
cpuhp_state = readers_fast;
break;
case GP_PENDING:
cpuhp_state = readers_slow;
break;
}
}

Doesn't make sense in this particular case, but perhaps in general.

Oleg.



\
 
 \ /
  Last update: 2013-10-03 22:01    [W:0.072 / U:1.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site