Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'wq-for-7.0-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue fix from Tejun Heo:
"This is a fix for a stall which triggers on ordered workqueues when
there are multiple inactive work items during workqueue property
changes through sysfs, which doesn't happen that frequently.

While really late, the fix is very low risk as it just repeats an
operation which is already being performed:

- Fix incomplete activation of multiple inactive works when
unplugging a pool_workqueue, where the pending_pwqs list
wasn't being updated for subsequent works"

* tag 'wq-for-7.0-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
workqueue: Add pool_workqueue to pending_pwqs list when unplugging multiple inactive works

+13 -1
+13 -1
kernel/workqueue.c
··· 1849 1849 raw_spin_lock_irq(&pwq->pool->lock); 1850 1850 if (pwq->plugged) { 1851 1851 pwq->plugged = false; 1852 - if (pwq_activate_first_inactive(pwq, true)) 1852 + if (pwq_activate_first_inactive(pwq, true)) { 1853 + /* 1854 + * While plugged, queueing skips activation which 1855 + * includes bumping the nr_active count and adding the 1856 + * pwq to nna->pending_pwqs if the count can't be 1857 + * obtained. We need to restore both for the pwq being 1858 + * unplugged. The first call activates the first 1859 + * inactive work item and the second, if there are more 1860 + * inactive, puts the pwq on pending_pwqs. 1861 + */ 1862 + pwq_activate_first_inactive(pwq, false); 1863 + 1853 1864 kick_pool(pwq->pool); 1865 + } 1854 1866 } 1855 1867 raw_spin_unlock_irq(&pwq->pool->lock); 1856 1868 }