]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-4.4' into for-next
authorTejun Heo <tj@kernel.org>
Mon, 12 Oct 2015 16:19:09 +0000 (12:19 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 12 Oct 2015 16:19:09 +0000 (12:19 -0400)
1  2 
kernel/workqueue.c

diff --combined kernel/workqueue.c
index bcb14cafe007148b15edb5cfed5adc041a6d966c,96d37473504049432884b6275b8a7c58165e238e..c579dbab2e36ab20dd94a5f753a480df17ae28ff
@@@ -1458,13 -1458,13 +1458,13 @@@ static void __queue_delayed_work(int cp
        timer_stats_timer_set_start_info(&dwork->timer);
  
        dwork->wq = wq;
 +      /* timer isn't guaranteed to run in this cpu, record earlier */
 +      if (cpu == WORK_CPU_UNBOUND)
 +              cpu = raw_smp_processor_id();
        dwork->cpu = cpu;
        timer->expires = jiffies + delay;
  
 -      if (unlikely(cpu != WORK_CPU_UNBOUND))
 -              add_timer_on(timer, cpu);
 -      else
 -              add_timer(timer);
 +      add_timer_on(timer, cpu);
  }
  
  /**
@@@ -3199,6 -3199,7 +3199,7 @@@ static struct worker_pool *get_unbound_
        u32 hash = wqattrs_hash(attrs);
        struct worker_pool *pool;
        int node;
+       int target_node = NUMA_NO_NODE;
  
        lockdep_assert_held(&wq_pool_mutex);
  
                }
        }
  
+       /* if cpumask is contained inside a NUMA node, we belong to that node */
+       if (wq_numa_enabled) {
+               for_each_node(node) {
+                       if (cpumask_subset(attrs->cpumask,
+                                          wq_numa_possible_cpumask[node])) {
+                               target_node = node;
+                               break;
+                       }
+               }
+       }
        /* nope, create a new one */
-       pool = kzalloc(sizeof(*pool), GFP_KERNEL);
+       pool = kzalloc_node(sizeof(*pool), GFP_KERNEL, target_node);
        if (!pool || init_worker_pool(pool) < 0)
                goto fail;
  
        lockdep_set_subclass(&pool->lock, 1);   /* see put_pwq() */
        copy_workqueue_attrs(pool->attrs, attrs);
+       pool->node = target_node;
  
        /*
         * no_numa isn't a worker_pool attribute, always clear it.  See
         */
        pool->attrs->no_numa = false;
  
-       /* if cpumask is contained inside a NUMA node, we belong to that node */
-       if (wq_numa_enabled) {
-               for_each_node(node) {
-                       if (cpumask_subset(pool->attrs->cpumask,
-                                          wq_numa_possible_cpumask[node])) {
-                               pool->node = node;
-                               break;
-                       }
-               }
-       }
        if (worker_pool_assign_id(pool) < 0)
                goto fail;