]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'sched/urgent' into sched/core
authorThomas Gleixner <tglx@linutronix.de>
Mon, 13 Aug 2012 16:56:46 +0000 (18:56 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 13 Aug 2012 16:56:46 +0000 (18:56 +0200)
1  2 
kernel/sched/core.c

diff --combined kernel/sched/core.c
index 82ad284f823b6a60e81b1ebef44bae94ca73db6e,6aa212f3c581b3a4d8f002f564b4338c1ca88cf8..fbf1fd098dc6cca687f0e9296a931aa0425c6fee
@@@ -1910,12 -1910,12 +1910,12 @@@ static inline voi
  prepare_task_switch(struct rq *rq, struct task_struct *prev,
                    struct task_struct *next)
  {
 +      trace_sched_switch(prev, next);
        sched_info_switch(prev, next);
        perf_event_task_sched_out(prev, next);
        fire_sched_out_preempt_notifiers(prev, next);
        prepare_lock_switch(rq, next);
        prepare_arch_switch(next);
 -      trace_sched_switch(prev, next);
  }
  
  /**
@@@ -3142,6 -3142,20 +3142,20 @@@ void thread_group_times(struct task_str
  # define nsecs_to_cputime(__nsecs)    nsecs_to_jiffies(__nsecs)
  #endif
  
+ static cputime_t scale_utime(cputime_t utime, cputime_t rtime, cputime_t total)
+ {
+       u64 temp = (__force u64) rtime;
+       temp *= (__force u64) utime;
+       if (sizeof(cputime_t) == 4)
+               temp = div_u64(temp, (__force u32) total);
+       else
+               temp = div64_u64(temp, (__force u64) total);
+       return (__force cputime_t) temp;
+ }
  void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
  {
        cputime_t rtime, utime = p->utime, total = utime + p->stime;
         */
        rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
  
-       if (total) {
-               u64 temp = (__force u64) rtime;
-               temp *= (__force u64) utime;
-               do_div(temp, (__force u32) total);
-               utime = (__force cputime_t) temp;
-       } else
+       if (total)
+               utime = scale_utime(utime, rtime, total);
+       else
                utime = rtime;
  
        /*
@@@ -3184,13 -3194,9 +3194,9 @@@ void thread_group_times(struct task_str
        total = cputime.utime + cputime.stime;
        rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
  
-       if (total) {
-               u64 temp = (__force u64) rtime;
-               temp *= (__force u64) cputime.utime;
-               do_div(temp, (__force u32) total);
-               utime = (__force cputime_t) temp;
-       } else
+       if (total)
+               utime = scale_utime(cputime.utime, rtime, total);
+       else
                utime = rtime;
  
        sig->prev_utime = max(sig->prev_utime, utime);
@@@ -7246,6 -7252,7 +7252,7 @@@ int in_sched_functions(unsigned long ad
  
  #ifdef CONFIG_CGROUP_SCHED
  struct task_group root_task_group;
+ LIST_HEAD(task_groups);
  #endif
  
  DECLARE_PER_CPU(cpumask_var_t, load_balance_tmpmask);