]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'cputime/cputime'
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 4 Nov 2011 03:37:32 +0000 (14:37 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 4 Nov 2011 03:37:32 +0000 (14:37 +1100)
Conflicts:
fs/proc/stat.c
include/asm-generic/cputime.h
kernel/sched_stats.h

12 files changed:
1  2 
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_ondemand.c
fs/proc/stat.c
include/asm-generic/cputime.h
include/linux/sched.h
kernel/exit.c
kernel/fork.c
kernel/posix-cpu-timers.c
kernel/sched.c
kernel/sched_stats.h
kernel/signal.c
kernel/sys.c

Simple merge
diff --cc fs/proc/stat.c
index 42b274da92c39d539c7c2f0f82a2f825c1a20383,566cd04b27a178a201230f0304005688df54a8f7..f634cd73a5a9fdf15608e8c666a0b7e0e5d06c49
  #define arch_idle_time(cpu) 0
  #endif
  
-               idle = kstat_cpu(cpu).cpustat.idle;
-               idle = cputime64_add(idle, arch_idle_time(cpu));
 +static cputime64_t get_idle_time(int cpu)
 +{
 +      u64 idle_time = get_cpu_idle_time_us(cpu, NULL);
 +      cputime64_t idle;
 +
 +      if (idle_time == -1ULL) {
 +              /* !NO_HZ so we can rely on cpustat.idle */
++              idle = kstat_cpu(cpu).cpustat.idle + arch_idle_time(cpu);
 +      } else
 +              idle = usecs_to_cputime(idle_time);
 +
 +      return idle;
 +}
 +
 +static cputime64_t get_iowait_time(int cpu)
 +{
 +      u64 iowait_time = get_cpu_iowait_time_us(cpu, NULL);
 +      cputime64_t iowait;
 +
 +      if (iowait_time == -1ULL)
 +              /* !NO_HZ so we can rely on cpustat.iowait */
 +              iowait = kstat_cpu(cpu).cpustat.iowait;
 +      else
 +              iowait = usecs_to_cputime(iowait_time);
 +
 +      return iowait;
 +}
 +
  static int show_stat(struct seq_file *p, void *v)
  {
        int i, j;
        jif = boottime.tv_sec;
  
        for_each_possible_cpu(i) {
-               user = cputime64_add(user, kstat_cpu(i).cpustat.user);
-               nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
-               system = cputime64_add(system, kstat_cpu(i).cpustat.system);
-               idle = cputime64_add(idle, get_idle_time(i));
-               iowait = cputime64_add(iowait, get_iowait_time(i));
-               irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
-               softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
-               steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
-               guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
-               guest_nice = cputime64_add(guest_nice,
-                       kstat_cpu(i).cpustat.guest_nice);
+               user += kstat_cpu(i).cpustat.user;
+               nice += kstat_cpu(i).cpustat.nice;
+               system += kstat_cpu(i).cpustat.system;
 -              idle += kstat_cpu(i).cpustat.idle + arch_idle_time(i);
 -              iowait += kstat_cpu(i).cpustat.iowait;
++              idle += get_idle_time(i);
++              iowait +=  get_iowait_time(i);
+               irq += kstat_cpu(i).cpustat.irq;
+               softirq += kstat_cpu(i).cpustat.softirq;
+               steal += kstat_cpu(i).cpustat.steal;
+               guest += kstat_cpu(i).cpustat.guest;
+               guest_nice += kstat_cpu(i).cpustat.guest_nice;
                sum += kstat_cpu_irqs_sum(i);
                sum += arch_irq_stat_cpu(i);
  
index 62ce6823c0f2ac82ccdf285cf99dc8d36a9bb80b,77202e2c9fc508289d26aa4afb5f67ab26a9631b..d88781bce9904a7b7bbdb8a72b2d97c3eae4dd6c
@@@ -38,8 -23,10 +23,10 @@@ typedef u64 __nocast cputime64_t
  /*
   * Convert cputime to microseconds and back.
   */
- #define cputime_to_usecs(__ct)                jiffies_to_usecs(__ct)
- #define usecs_to_cputime(__msecs)     usecs_to_jiffies(__msecs)
+ #define cputime_to_usecs(__ct)                \
 -      jiffies_to_usecs(cputime_to_jiffies(__ct));
++      jiffies_to_usecs(cputime_to_jiffies(__ct))
+ #define usecs_to_cputime(__msecs)     \
 -      jiffies_to_cputime(usecs_to_jiffies(__msecs));
++      jiffies_to_cputime(usecs_to_jiffies(__msecs))
  
  /*
   * Convert cputime to seconds and back.
Simple merge
diff --cc kernel/exit.c
Simple merge
diff --cc kernel/fork.c
Simple merge
Simple merge
diff --cc kernel/sched.c
Simple merge
index 87f9e36ea56ef5b337150be441bb8c36f24ae048,a455e625fa10c2cd217d03fde4cb9da5caba5b89..4b71dbef271df9ca8d70fbebe653b234ed3ce197
@@@ -282,10 -282,9 +282,9 @@@ static inline void account_group_user_t
        if (!cputimer->running)
                return;
  
 -      spin_lock(&cputimer->lock);
 +      raw_spin_lock(&cputimer->lock);
-       cputimer->cputime.utime =
-               cputime_add(cputimer->cputime.utime, cputime);
+       cputimer->cputime.utime += cputime;
 -      spin_unlock(&cputimer->lock);
 +      raw_spin_unlock(&cputimer->lock);
  }
  
  /**
@@@ -306,10 -305,9 +305,9 @@@ static inline void account_group_system
        if (!cputimer->running)
                return;
  
 -      spin_lock(&cputimer->lock);
 +      raw_spin_lock(&cputimer->lock);
-       cputimer->cputime.stime =
-               cputime_add(cputimer->cputime.stime, cputime);
+       cputimer->cputime.stime += cputime;
 -      spin_unlock(&cputimer->lock);
 +      raw_spin_unlock(&cputimer->lock);
  }
  
  /**
diff --cc kernel/signal.c
Simple merge
diff --cc kernel/sys.c
Simple merge