• Sebastian Andrzej Siewior's avatar
    net: Remove conditional threaded-NAPI wakeup based on task state. · 56364c91
    Sebastian Andrzej Siewior authored
    A NAPI thread is scheduled by first setting NAPI_STATE_SCHED bit. If
    successful (the bit was not yet set) then the NAPI_STATE_SCHED_THREADED
    is set but only if thread's state is not TASK_INTERRUPTIBLE (is
    TASK_RUNNING) followed by task wakeup.
    
    If the task is idle (TASK_INTERRUPTIBLE) then the
    NAPI_STATE_SCHED_THREADED bit is not set. The thread is no relying on
    the bit but always leaving the wait-loop after returning from schedule()
    because there must have been a wakeup.
    
    The smpboot-threads implementation for per-CPU threads requires an
    explicit condition and does not support "if we get out of schedule()
    then there must be something to do".
    
    Removing this optimisation simplifies the following integration.
    
    Set NAPI_STATE_SCHED_THREADED unconditionally on wakeup and rely on it
    in the wait path by removing the `woken' condition.
    Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    56364c91
dev.c 299 KB