[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170414085459.sp3psluw647ab4lw@hirez.programming.kicks-ass.net>
Date: Fri, 14 Apr 2017 10:54:59 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
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 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.
Powered by blists - more mailing lists