Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Convert obsolete cputime type to nsecs

Use the new nsec based cputime accessors as part of the whole cputime
conversion from cputime_t to nsecs.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wanpeng Li <wanpeng.li@hotmail.com>
Link: http://lkml.kernel.org/r/1485832191-26889-10-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Frederic Weisbecker and committed by
Ingo Molnar
f7dcd63d dc9b77b5

+4 -4
+4 -4
arch/x86/kernel/apm_32.c
··· 905 905 { 906 906 static int use_apm_idle; /* = 0 */ 907 907 static unsigned int last_jiffies; /* = 0 */ 908 - static unsigned int last_stime; /* = 0 */ 909 - cputime_t stime, utime; 908 + static u64 last_stime; /* = 0 */ 909 + u64 stime, utime; 910 910 911 911 int apm_idle_done = 0; 912 912 unsigned int jiffies_since_last_check = jiffies - last_jiffies; 913 913 unsigned int bucket; 914 914 915 915 recalc: 916 - task_cputime_t(current, &utime, &stime); 916 + task_cputime(current, &utime, &stime); 917 917 if (jiffies_since_last_check > IDLE_CALC_LIMIT) { 918 918 use_apm_idle = 0; 919 919 } else if (jiffies_since_last_check > idle_period) { 920 920 unsigned int idle_percentage; 921 921 922 - idle_percentage = cputime_to_jiffies(stime - last_stime); 922 + idle_percentage = nsecs_to_jiffies(stime - last_stime); 923 923 idle_percentage *= 100; 924 924 idle_percentage /= jiffies_since_last_check; 925 925 use_apm_idle = (idle_percentage > idle_threshold);