Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Tejun Heo
Hello, Michael. On Thu, Jul 27, 2017 at 03:15:47PM -0500, Michael Bringmann wrote: > There is an underlying assumption in many layers / modules of the Linux > system that CPU <-> node mapping is static. This is despite the presence > of features like NUMA and 'hotplug' that support the dynamic ad

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Michael Bringmann
Revised text: There is an underlying assumption in many layers / modules of the Linux system that CPU <-> node mapping is static. This is despite the presence of features like NUMA and 'hotplug' that support the dynamic addition/ removal of fundamental system resources like CPUs and memory. Powe

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Tejun Heo
On Thu, Jul 27, 2017 at 02:12:52PM -0500, Michael Bringmann wrote: > > >> > >>/* yeap, return possible CPUs in @node that @attrs wants */ > >>cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); > >> + > >> + if (cpumask_empty(cpumask)) { > >> + pr_warn_once("WAR

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Tejun Heo
Hello, Michael. On Thu, Jul 27, 2017 at 02:07:53PM -0500, Michael Bringmann wrote: > The problem lies with the ordering of events with respect to the order in > which we add (or remove) CPUs to NUMA systems, and make use of that knowledge. Isn't the root cause that the upper layers including work

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Michael Bringmann
>> >> /* yeap, return possible CPUs in @node that @attrs wants */ >> cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]); >> + >> +if (cpumask_empty(cpumask)) { >> +pr_warn_once("WARNING: workqueue cpumask: onl intersect > " >

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Michael Bringmann
On 07/27/2017 01:31 PM, Tejun Heo wrote: > On Thu, Jul 27, 2017 at 01:15:48PM -0500, Michael Bringmann wrote: >> >> On NUMA systems with dynamic processors, the content of the cpumask >> may change over time. As new processors are added via DLPAR operations, >> workqueues are created for them.

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Nathan Fontenot
On 07/27/2017 01:15 PM, Michael Bringmann wrote: > > On NUMA systems with dynamic processors, the content of the cpumask > may change over time. As new processors are added via DLPAR operations, > workqueues are created for them. Depending upon the order in which CPUs > are added/removed, we may

Re: [PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Tejun Heo
On Thu, Jul 27, 2017 at 01:15:48PM -0500, Michael Bringmann wrote: > > On NUMA systems with dynamic processors, the content of the cpumask > may change over time. As new processors are added via DLPAR operations, > workqueues are created for them. Depending upon the order in which CPUs > are add

[PATCH v6] workqueue: Fix edge cases for calc of pool's cpumask

2017-07-27 Thread Michael Bringmann
On NUMA systems with dynamic processors, the content of the cpumask may change over time. As new processors are added via DLPAR operations, workqueues are created for them. Depending upon the order in which CPUs are added/removed, we may run into problems with the content of the cpumask used by