lkml.org 
[lkml]   [2019]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v3 1/9] smp: Run functions concurrently in smp_call_function_many()
    Date
    > On Jul 22, 2019, at 11:37 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
    >
    > On Mon, 22 Jul 2019, Peter Zijlstra wrote:
    >
    >> On Thu, Jul 18, 2019 at 05:58:29PM -0700, Nadav Amit wrote:
    >>> +/*
    >>> + * Call a function on all processors. May be used during early boot while
    >>> + * early_boot_irqs_disabled is set.
    >>> + */
    >>> +static inline void on_each_cpu(smp_call_func_t func, void *info, int wait)
    >>> +{
    >>> + on_each_cpu_mask(cpu_online_mask, func, info, wait);
    >>> +}
    >>
    >> I'm thinking that one if buggy, nothing protects online mask here.
    >
    > The current implementation has preemption disabled before touching
    > cpu_online_mask which at least protects against a CPU going away as that
    > prevents the stomp machine thread from getting on the CPU. But it's not
    > protected against a CPU coming online concurrently.

    I still don’t understand. If you called cpu_online_mask() and did not
    disable preemption before calling it, you are already (today) not protected
    against another CPU coming online. Disabling preemption in on_each_cpu()
    will not solve it.

    \
     
     \ /
      Last update: 2019-07-22 20:41    [W:2.217 / U:0.712 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site