diff --git a/kernel/workqueue.c b/kernel/workqueue.c index cdf9d9538d497ea305eeb3de8d143f4c5be60741..118cf73aeb3a9e533650448a39c267b7606a55dc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3843,6 +3843,9 @@ apply_wqattrs_prepare(struct workqueue_struct *wq, * wq_unbound_cpumask, we fallback to the wq_unbound_cpumask. */ copy_workqueue_attrs(new_attrs, attrs); + if (wq->flags & __WQ_DYNAMIC) + new_attrs->no_numa = false; + cpumask_and(new_attrs->cpumask, new_attrs->cpumask, wq_unbound_cpumask); if (unlikely(cpumask_empty(new_attrs->cpumask))) cpumask_copy(new_attrs->cpumask, wq_unbound_cpumask); @@ -4092,10 +4095,12 @@ static int alloc_and_link_pwqs(struct workqueue_struct *wq) return 0; } else if (wq->flags & __WQ_ORDERED) { ret = apply_workqueue_attrs(wq, ordered_wq_attrs[highpri]); - /* there should only be single pwq for ordering guarantee */ - WARN(!ret && (wq->pwqs.next != &wq->dfl_pwq->pwqs_node || - wq->pwqs.prev != &wq->dfl_pwq->pwqs_node), - "ordering guarantee broken for workqueue %s\n", wq->name); + if (!(wq->flags & __WQ_DYNAMIC)) { + /* there should only be single pwq for ordering guarantee */ + WARN(!ret && (wq->pwqs.next != &wq->dfl_pwq->pwqs_node || + wq->pwqs.prev != &wq->dfl_pwq->pwqs_node), + "ordering guarantee broken for workqueue %s\n", wq->name); + } return ret; } else { return apply_workqueue_attrs(wq, unbound_std_wq_attrs[highpri]); @@ -5166,7 +5171,7 @@ static int workqueue_apply_unbound_cpumask(void) if (!(wq->flags & WQ_UNBOUND)) continue; /* creating multiple pwqs breaks ordering guarantee */ - if (wq->flags & __WQ_ORDERED) + if ((wq->flags & __WQ_ORDERED) && !(wq->flags & __WQ_DYNAMIC)) continue; ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs);