]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'numa/core'
authorIngo Molnar <mingo@kernel.org>
Thu, 18 Oct 2012 09:52:59 +0000 (11:52 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 18 Oct 2012 09:52:59 +0000 (11:52 +0200)
1  2 
kernel/sched/fair.c

diff --combined kernel/sched/fair.c
index 00fd74cdcf8f7cf998d2ad06fd85f1e24ca26266,1e24aa17cf9429248fb6445e94f5d785fb027d03..2679bcfec7310410cd09d1b04bcb531399d753ec
@@@ -900,8 -900,9 +900,9 @@@ void task_numa_work(struct callback_hea
        struct task_struct *p = current;
        struct mm_struct *mm = p->mm;
  
-       WARN_ON_ONCE(p != container_of(work, struct task_struct, rcu));
+       WARN_ON_ONCE(p != container_of(work, struct task_struct, numa_work));
  
+       work->next = work; /* protect against double add */
        /*
         * Who cares about NUMA placement when they're dying.
         *
   */
  void task_tick_numa(struct rq *rq, struct task_struct *curr)
  {
+       struct callback_head *work = &curr->numa_work;
        u64 period, now;
  
        /*
         * We don't care about NUMA placement if we don't have memory.
         */
-       if (!curr->mm)
+       if (!curr->mm || (curr->flags & PF_EXITING) || work->next != work)
                return;
  
        /*
                curr->node_stamp = now;
  
                if (!time_before(jiffies, curr->mm->numa_next_scan)) {
-                       /*
-                        * We can re-use curr->rcu because we checked curr->mm
-                        * != NULL so release_task()->call_rcu() was not called
-                        * yet and exit_task_work() is called before
-                        * exit_notify().
-                        */
-                       init_task_work(&curr->rcu, task_numa_work);
-                       task_work_add(curr, &curr->rcu, true);
+                       init_task_work(work, task_numa_work); /* TODO: move this into sched_fork() */
+                       task_work_add(curr, work, true);
                }
        }
  }
@@@ -3189,7 -3185,7 +3185,7 @@@ static void check_preempt_wakeup(struc
         * Batch and idle tasks do not preempt non-idle tasks (their preemption
         * is driven by the tick):
         */
 -      if (unlikely(p->policy != SCHED_NORMAL))
 +      if (unlikely(p->policy != SCHED_NORMAL) || !sched_feat(WAKEUP_PREEMPTION))
                return;
  
        find_matching_se(&se, &pse);