Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40565b5a authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Ingo Molnar
Browse files

sched/cputime, powerpc, s390: Make scaled cputime arch specific



Only s390 and powerpc have hardware facilities allowing to measure
cputimes scaled by frequency. On all other architectures
utimescaled/stimescaled are equal to utime/stime (however they are
accounted separately).

Remove {u,s}timescaled accounting on all architectures except
powerpc and s390, where those values are explicitly accounted
in the proper places.

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161031162143.GB12646@redhat.com


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 981ee2d4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -512,6 +512,9 @@ config HAVE_CONTEXT_TRACKING
config HAVE_VIRT_CPU_ACCOUNTING
	bool

config ARCH_HAS_SCALED_CPUTIME
	bool

config HAVE_VIRT_CPU_ACCOUNTING_GEN
	bool
	default y if 64BIT
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ void vtime_account_user(struct task_struct *tsk)

	if (ti->ac_utime) {
		delta_utime = cycle_to_cputime(ti->ac_utime);
		account_user_time(tsk, delta_utime, delta_utime);
		account_user_time(tsk, delta_utime);
		ti->ac_utime = 0;
	}
}
@@ -112,7 +112,7 @@ void vtime_account_system(struct task_struct *tsk)
{
	cputime_t delta = vtime_delta(tsk);

	account_system_time(tsk, 0, delta, delta);
	account_system_time(tsk, 0, delta);
}
EXPORT_SYMBOL_GPL(vtime_account_system);

+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ config PPC
	select HAVE_LIVEPATCH if HAVE_DYNAMIC_FTRACE_WITH_REGS
	select GENERIC_CPU_AUTOPROBE
	select HAVE_VIRT_CPU_ACCOUNTING
	select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE
	select HAVE_ARCH_HARDENED_USERCOPY
	select HAVE_KERNEL_GZIP

+4 −2
Original line number Diff line number Diff line
@@ -358,7 +358,8 @@ void vtime_account_system(struct task_struct *tsk)
	unsigned long delta, sys_scaled, stolen;

	delta = vtime_delta(tsk, &sys_scaled, &stolen);
	account_system_time(tsk, 0, delta, sys_scaled);
	account_system_time(tsk, 0, delta);
	tsk->stimescaled += sys_scaled;
	if (stolen)
		account_steal_time(stolen);
}
@@ -391,7 +392,8 @@ void vtime_account_user(struct task_struct *tsk)
	acct->user_time = 0;
	acct->user_time_scaled = 0;
	acct->utime_sspurr = 0;
	account_user_time(tsk, utime, utimescaled);
	account_user_time(tsk, utime);
	tsk->utimescaled += utimescaled;
}

#ifdef CONFIG_PPC32
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ config S390
	select SYSCTL_EXCEPTION_TRACE
	select TTY
	select VIRT_CPU_ACCOUNTING
	select ARCH_HAS_SCALED_CPUTIME
	select VIRT_TO_BUS
	select HAVE_NMI

Loading