• Matthias Kaehlcke's avatar
    kthread: Add __kthread_should_park() · 0121805d
    Matthias Kaehlcke authored
    kthread_should_park() is used to check if the calling kthread ('current')
    should park, but there is no function to check whether an arbitrary kthread
    should be parked. The latter is required to plug a CPU hotplug race vs. a
    parking ksoftirqd thread.
    
    The new __kthread_should_park() receives a task_struct as parameter to
    check if the corresponding kernel thread should be parked.
    
    Call __kthread_should_park() from kthread_should_park() to avoid code
    duplication.
    Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Cc: Douglas Anderson <dianders@chromium.org>
    Cc: Stephen Boyd <swboyd@chromium.org>
    Link: https://lkml.kernel.org/r/20190128234625.78241-2-mka@chromium.org
    0121805d
kthread.c 33.9 KB