[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1704141150340.2327@nanos>
Date: Fri, 14 Apr 2017 11:51:07 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Sebastian Siewior <bigeasy@...utronix.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"David S. Miller" <davem@...emloft.net>,
Fenghua Yu <fenghua.yu@...el.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Lai Jiangshan <jiangshanlai@...il.com>,
Len Brown <lenb@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
"Rafael J. Wysocki" <rjw@...ysocki.net>, Tejun Heo <tj@...nel.org>,
Tony Luck <tony.luck@...el.com>,
Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [patch 02/13] workqueue: Provide work_on_cpu_safe()
On Fri, 14 Apr 2017, Peter Zijlstra wrote:
> On Wed, Apr 12, 2017 at 10:07:28PM +0200, Thomas Gleixner wrote:
> > +long work_on_cpu_safe(int cpu, long (*fn)(void *), void *arg)
> > +{
> > + long ret = -ENODEV;
> > +
> > + get_online_cpus();
> > + if (cpu_online(cpu))
> > + ret = work_on_cpu(cpu, fn, arg);
> > + put_online_cpus();
> > + return ret;
> > +}
>
> But doesn't workqueue have this lovelt 'feature' where it will unbind
> per-cpu work and run it on random CPUs when hotplug happens?
>
> That is, I think you need a flush_work() before put_online_cpus() if you
> want to guarantee anything.
work_on_cpu() is sychnronous, it flushes already.
Thanks,
tglx
Powered by blists - more mailing lists