workqueue: Override implicit ordered attribute in workqueue_apply_unbound_cpumask()
ANBZ: #9497 commitca10d851b9
upstream. Commit5c0338c687
("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") enabled implicit ordered attribute to be added to WQ_UNBOUND workqueues with max_active of 1. This prevented the changing of attributes to these workqueues leading to fix commit0a94efb5ac
("workqueue: implicit ordered attribute should be overridable"). However, workqueue_apply_unbound_cpumask() was not updated at that time. So sysfs changes to wq_unbound_cpumask has no effect on WQ_UNBOUND workqueues with implicit ordered attribute. Since not all WQ_UNBOUND workqueues are visible on sysfs, we are not able to make all the necessary cpumask changes even if we iterates all the workqueue cpumasks in sysfs and changing them one by one. Fix this problem by applying the corresponding change made to apply_workqueue_attrs_locked() in the fix commit to workqueue_apply_unbound_cpumask(). Fixes:5c0338c687
("workqueue: restore WQ_UNBOUND/max_active==1 to be ordered") Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com> Reviewed-by: Cruz Zhao <CruzZhao@linux.alibaba.com> Link: https://gitee.com/anolis/cloud-kernel/pulls/3549
This commit is contained in:
parent
7c43d57812
commit
8015f4baf3
|
@ -5300,9 +5300,13 @@ static int workqueue_apply_unbound_cpumask(void)
|
|||
list_for_each_entry(wq, &workqueues, list) {
|
||||
if (!(wq->flags & WQ_UNBOUND))
|
||||
continue;
|
||||
|
||||
/* creating multiple pwqs breaks ordering guarantee */
|
||||
if (wq->flags & __WQ_ORDERED)
|
||||
continue;
|
||||
if (!list_empty(&wq->pwqs)) {
|
||||
if (wq->flags & __WQ_ORDERED_EXPLICIT)
|
||||
continue;
|
||||
wq->flags &= ~__WQ_ORDERED;
|
||||
}
|
||||
|
||||
ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs);
|
||||
if (!ctx) {
|
||||
|
|
Loading…
Reference in New Issue