• Tejun Heo's avatar
    workqueue: Make wq_adjust_max_active() round-robin pwqs while activating · c5404d4e
    Tejun Heo authored
    wq_adjust_max_active() needs to activate work items after max_active is
    increased. Previously, it did that by visiting each pwq once activating all
    that could be activated. While this makes sense with per-pwq nr_active,
    nr_active will be shared across multiple pwqs for unbound wqs. Then, we'd
    want to round-robin through pwqs to be fairer.
    
    In preparation, this patch makes wq_adjust_max_active() round-robin pwqs
    while activating. While the activation ordering changes, this shouldn't
    cause user-noticeable behavior changes.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Reviewed-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
    c5404d4e
workqueue.c 194 KB