lkml.org 
[lkml]   [2014]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] workqueue: update wq_numa_possible_cpumask
On Fri, Dec 12, 2014 at 06:19:52PM +0800, Lai Jiangshan wrote:
...
> +static void wq_update_numa_mapping(int cpu)
> +{
> + int node, orig_node = NUMA_NO_NODE, new_node = cpu_to_node(cpu);
> +
> + lockdep_assert_held(&wq_pool_mutex);
> +
> + if (!wq_numa_enabled)
> + return;
> +
> + /* the node of onlining CPU is not NUMA_NO_NODE */
> + if (WARN_ON(new_node == NUMA_NO_NODE))
> + return;
> +
> + /* test whether the NUMA node mapping is changed. */
> + if (cpumask_test_cpu(cpu, wq_numa_possible_cpumask[new_node]))
> + return;
> +
> + /* find the origin node */
> + for_each_node(node) {
> + if (cpumask_test_cpu(cpu, wq_numa_possible_cpumask[node])) {
> + orig_node = node;
> + break;
> + }
> + }
> +
> + /* there may be multi mappings changed, re-initial. */
> + cpumask_clear(wq_numa_possible_cpumask[new_node]);
> + if (orig_node != NUMA_NO_NODE)
> + cpumask_clear(wq_numa_possible_cpumask[orig_node]);
> + for_each_possible_cpu(cpu) {
> + node = cpu_to_node(node);
> + if (node == new_node)
> + cpumask_set_cpu(cpu, wq_numa_possible_cpumask[new_node]);
> + else if (orig_node != NUMA_NO_NODE && node == orig_node)
> + cpumask_set_cpu(cpu, wq_numa_possible_cpumask[orig_node]);
> + }
> +}

Let's please move this to NUMA code and properly update it on actual
mapping changes.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2014-12-12 19:01    [W:0.125 / U:1.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site