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

cputime: remove cputime_to_nsecs fallback

The archs that use cputime_to_nsecs() internally provide their own
definition and don't need the fallback. cputime_to_usecs() unused except
in this fallback, and is not defined anywhere.

This removes the final remnant of the cputime_t code from the kernel.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20221220070705.2958959-1-npiggin@gmail.com

authored by

Nicholas Piggin and committed by
Peter Zijlstra
c8997020 8589018a

+6 -11
+1 -1
arch/s390/kernel/idle.c
··· 12 12 #include <linux/notifier.h> 13 13 #include <linux/init.h> 14 14 #include <linux/cpu.h> 15 - #include <linux/sched/cputime.h> 16 15 #include <trace/events/power.h> 17 16 #include <asm/cpu_mf.h> 17 + #include <asm/cputime.h> 18 18 #include <asm/nmi.h> 19 19 #include <asm/smp.h> 20 20 #include "entry.h"
+1 -1
arch/s390/kernel/vtime.c
··· 7 7 */ 8 8 9 9 #include <linux/kernel_stat.h> 10 - #include <linux/sched/cputime.h> 11 10 #include <linux/export.h> 12 11 #include <linux/kernel.h> 13 12 #include <linux/timex.h> 14 13 #include <linux/types.h> 15 14 #include <linux/time.h> 16 15 #include <asm/alternative.h> 16 + #include <asm/cputime.h> 17 17 #include <asm/vtimer.h> 18 18 #include <asm/vtime.h> 19 19 #include <asm/cpu_mf.h>
-9
include/linux/sched/cputime.h
··· 8 8 * cputime accounting APIs: 9 9 */ 10 10 11 - #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 12 - #include <asm/cputime.h> 13 - 14 - #ifndef cputime_to_nsecs 15 - # define cputime_to_nsecs(__ct) \ 16 - (cputime_to_usecs(__ct) * NSEC_PER_USEC) 17 - #endif 18 - #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ 19 - 20 11 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 21 12 extern bool task_cputime(struct task_struct *t, 22 13 u64 *utime, u64 *stime);
+4
kernel/sched/cputime.c
··· 3 3 * Simple CPU accounting cgroup controller 4 4 */ 5 5 6 + #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 7 + #include <asm/cputime.h> 8 + #endif 9 + 6 10 #ifdef CONFIG_IRQ_TIME_ACCOUNTING 7 11 8 12 /*