lkml.org 
[lkml]   [2017]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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.

    \
     
     \ /
      Last update: 2017-04-14 10:55    [W:4.349 / U:0.396 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site