• Lai Jiangshan's avatar
    workqueue: Avoid nr_active manipulation in grabbing inactive items · b56c7207
    Lai Jiangshan authored
    Current try_to_grab_pending() activates the inactive item and
    subsequently treats it as though it were a standard activated item.
    
    This approach prevents duplicating handling logic for both active and
    inactive items, yet the premature activation of an inactive item
    triggers trace_workqueue_activate_work(), yielding an unintended user
    space visible side effect.
    
    And the unnecessary increment of the nr_active, which is not a simple
    counter now, followed by a counteracted decrement, is inefficient and
    complicates the code.
    
    Just remove the nr_active manipulation code in grabbing inactive items.
    Signed-off-by: default avatarLai Jiangshan <jiangshan.ljs@antgroup.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    b56c7207
workqueue.c 223 KB