Skip to contentSkip to conversation

linux-next: build failure after merge of the workqueues tree

PATCH In review Stephen Rothwell 3 participants 6 messages Nov 2, 2017 – Nov 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Tejun,

After merging the workqueues tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

kernel/workqueue.c: In function 'workqueue_init_early':
kernel/workqueue.c:5561:56: error: 'cpu_isolated_map' undeclared (first use in this function)

  cpumask_andnot(wq_unbound_cpumask, cpu_possible_mask, cpu_isolated_map);
                                                        ^

Caused by commit

b5149873a0c2 ("workqueue: respect isolated cpus when queueing an unbound work")

interacting with commit

edb9382175c3 ("sched/isolation: Move isolcpus= handling to the housekeeping code")

from the tip tree.

I am not sure how to fix this, so I have reverted b5149873a0c2 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#1 lore raw
Quoted 14 lines · Stephen Rothwell

Hi Tejun,

After merging the workqueues tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

kernel/workqueue.c: In function 'workqueue_init_early':
kernel/workqueue.c:5561:56: error: 'cpu_isolated_map' undeclared (first use in this function)

  cpumask_andnot(wq_unbound_cpumask, cpu_possible_mask, cpu_isolated_map);
                                                        ^

Caused by commit

b5149873a0c2 ("workqueue: respect isolated cpus when queueing an unbound work")

Quoted 7 lines

interacting with commit

edb9382175c3 ("sched/isolation: Move isolcpus= handling to the housekeeping code")

from the tip tree.

I am not sure how to fix this, so I have reverted b5149873a0c2 for today.

I'm reverting it from my tree. Tal, can you please spin up a new patch against the sched branch? Let's either route it through sched branch or try again after the rc1.

Thanks.

Signature · 1 line
tejun
#3 lore raw

PATCH v3 2/2 workqueue: respect isolated cpus when queueing an unbound work

In reply to Tal Shorer

Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter.

---
 kernel/workqueue.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/workqueue.c +6 -1
index 64d0edf..a355e9d 100644
@@ -48,6 +48,7 @@
 #include <linux/nodemask.h>
 #include <linux/moduleparam.h>
 #include <linux/uaccess.h>
+#include <linux/sched/isolation.h>
 
 #include "workqueue_internal.h"
 
@@ -4980,6 +4981,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
 	if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL))
 		return -ENOMEM;
 
+	/*
+	 * Not excluding isolated cpus on purpose.
+	 * If the user wishes to include them, we allow that.
+	 */
 	cpumask_and(cpumask, cpumask, cpu_possible_mask);
 	if (!cpumask_empty(cpumask)) {
 		apply_wqattrs_lock();
@@ -5579,7 +5584,7 @@ int __init workqueue_init_early(void)
 	WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
 
 	BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
-	cpumask_copy(wq_unbound_cpumask, cpu_possible_mask);
+	cpumask_copy(wq_unbound_cpumask, housekeeping_cpumask(HK_FLAG_DOMAIN));
 
 	pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH v3 1/2 main: kernel_start: move housekeeping_init() before workqueue_init_early()

In reply to Tejun Heo

This is needed in order to allow the unbound workqueue to take housekeeping cpus into accounty

---
 init/main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
init/main.c +6 -1
index 4610c99..af6ecd0 100644
@@ -591,6 +591,12 @@ asmlinkage __visible void __init start_kernel(void)
 	radix_tree_init();
 
 	/*
+	 * Set up housekeeping before setting up workqueues to allow the unbound
+	 * workqueue to take non-housekeeping into account.
+	 */
+	housekeeping_init();
+
+	/*
 	 * Allow workqueue creation and work item queueing/cancelling
 	 * early.  Work item execution depends on kthreads and starts after
 	 * workqueue_init().
@@ -607,7 +613,6 @@ asmlinkage __visible void __init start_kernel(void)
 	early_irq_init();
 	init_IRQ();
 	tick_init();
-	housekeeping_init();
 	rcu_init_nohz();
 	init_timers();
 	hrtimers_init();
Signature · 1 line
2.7.4
maintainer Acked-by on v3 2/2
#4 lore raw

Re: [PATCH v3 2/2] workqueue: respect isolated cpus when queueing an unbound work

In reply to Tal Shorer
Quoted 4 lines · Tal Shorer

Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter.

Plese feel free to route with the prerequisite changes. If not, I'll apply them after the next -rc1 window.

Thanks.

Signature · 1 line
tejun
maintainer
#5 lore raw

Re: [PATCH v3 2/2] workqueue: respect isolated cpus when queueing an unbound work

In reply to Tal Shorer
Quoted 4 lines · Tal Shorer

Initialize wq_unbound_cpumask to exclude cpus that were isolated by the cmdline's isolcpus parameter.

Applied 1-2 to wq/for-4.15-fixes.

Thanks.

Signature · 1 line
tejun