lkml.org 
[lkml]   [2020]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 1/2] nohz: only wakeup a single target cpu when kicking a task
On Thu, Oct 08, 2020 at 05:28:44PM +0200, Peter Zijlstra wrote:
> On Thu, Oct 08, 2020 at 10:59:40AM -0400, Peter Xu wrote:
> > On Wed, Oct 07, 2020 at 03:01:52PM -0300, Marcelo Tosatti wrote:
> > > +static void tick_nohz_kick_task(struct task_struct *tsk)
> > > +{
> > > + int cpu = task_cpu(tsk);
> > > +
> > > + /*
> > > + * If the task concurrently migrates to another cpu,
> > > + * we guarantee it sees the new tick dependency upon
> > > + * schedule.
> > > + *
> > > + *
> > > + * set_task_cpu(p, cpu);
> > > + * STORE p->cpu = @cpu
> > > + * __schedule() (switch to task 'p')
> > > + * LOCK rq->lock
> > > + * smp_mb__after_spin_lock() STORE p->tick_dep_mask
> > > + * tick_nohz_task_switch() smp_mb() (atomic_fetch_or())
> > > + * LOAD p->tick_dep_mask LOAD p->cpu
> > > + */
> > > +
> > > + preempt_disable();
> >
> > Pure question: is preempt_disable() required here? Same question to
> > tick_nohz_full_kick_all().
>
> I think it serializes against hotplug.

Exactly!

Thanks.

\
 
 \ /
  Last update: 2020-10-08 21:48    [W:0.257 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site