History

Revert "workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask()"

This reverts commit ca10d851b9ad0338c19e8e3089e24d565ebfffd7. The commit allowed workqueue_apply_unbound_cpumask() to clear __WQ_ORDERED on now removed implicitly ordered workqueues. This was incorrect in that system-wide config change shouldn't break ordering properties of all workqueues. The reason why apply_workqueue_attrs() path was allowed to do so was because it was targeting the specific workqueue - either the workqueue had WQ_SYSFS set or the workqueue user specifically tried to change max_active, both of which indicate that the workqueue doesn't need to be ordered. The implicitly ordered workqueue promotion was removed by the previous commit 3bc1e711c26b ("workqueue: Don't implicitly make UNBOUND workqueues w/ @max_active==1 ordered"). However, it didn't update this path and broke build. Let's revert the commit which was incorrect in the first place which also fixes build.

Tejun Heo committed 2 years ago

Commit aac8a591 parent 052d5341 file · +2 −6Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+2−6
@@ -5786,13 +5786,9 @@ static int workqueue_apply_unbound_cpumask(const cpumask_var_t unbound_cpumask) · 5785 unmodified lines
5786 list_for_each_entry(wq, &workqueues, list) {5786 list_for_each_entry(wq, &workqueues, list) {
5787 if (!(wq->flags & WQ_UNBOUND))5787 if (!(wq->flags & WQ_UNBOUND))
5788 continue;5788 continue;
5789
5790 /* creating multiple pwqs breaks ordering guarantee */5789 /* creating multiple pwqs breaks ordering guarantee */
5791 if (!list_empty(&wq->pwqs)) {5790 if (wq->flags & __WQ_ORDERED)
5792 if (wq->flags & __WQ_ORDERED_EXPLICIT)5791 continue;
5793 continue;
5794 wq->flags &= ~__WQ_ORDERED;
5795 }
5796 5792
5797 ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs, unbound_cpumask);5793 ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs, unbound_cpumask);
5798 if (IS_ERR(ctx)) {5794 if (IS_ERR(ctx)) {