Re: [PATCH] rcu: Only pin GP kthread when full dynticks is actually used

Frederic Weisbecker
2014-06-13T16:09:47Z

On Fri, Jun 13, 2014 at 08:58:12AM -0700, Paul E. McKenney wrote:
> > Maybe what we should do instead is to have something like this on RCU kthread init:
> >
> > cpumask_var_t gp_kthread_mask;
> >
> > if (alloc_cpumask_var(gp_kthread_mask, GFP_KERNEL))
> > return -EFAULT;
> >
> > cpumask_andnot(gp_kthread_mask, cpu_possible_mask, tick_nohz_full_mask);
> >
> > set_cpus_allowed_ptr(current, gp_kthread_mask);
> >
> > free_cpumask_var(gp_kthread_mask);
>
> I was guessing that RCU's kthreads would not be the only ones that wanted
> similar binding. But if you feel strongly about this, we could at least
> start by placing it local to RCU as above.

Hmm, I don't feel well creating mirrored cpumasks (nor solely negation cpumasks in general).
Also exposing that nohz gut is probably not a good idea either, except for RCU due to
the sysidle stuff.

Now you're right that we can expect that this non-nohz affinity stuff is going to be reused.

Could it be housekeeping_affine(struct task_struct *tsk) maybe?