diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-01-30 14:08:47 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-02-08 14:10:49 +0100 |
commit | 2994e1babfc477a3101ec6841b9dc5b770c1ec18 (patch) | |
tree | 6241716dd17881482b9877ee39e7fc4acd065a17 /arch/powerpc/include/asm/cputime.h | |
parent | powerpc/64s: reconcile interrupts in C (diff) | |
download | linux-2994e1babfc477a3101ec6841b9dc5b770c1ec18.tar.xz linux-2994e1babfc477a3101ec6841b9dc5b770c1ec18.zip |
powerpc/64: move account_stolen_time into its own function
This will be used by interrupt entry as well.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-38-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/include/asm/cputime.h')
-rw-r--r-- | arch/powerpc/include/asm/cputime.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index ed75d1c318e3..504f7fe6711a 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h @@ -87,6 +87,17 @@ static notrace inline void account_cpu_user_exit(void) acct->starttime_user = tb; } +static notrace inline void account_stolen_time(void) +{ +#ifdef CONFIG_PPC_SPLPAR + if (firmware_has_feature(FW_FEATURE_SPLPAR)) { + struct lppaca *lp = local_paca->lppaca_ptr; + + if (unlikely(local_paca->dtl_ridx != be64_to_cpu(lp->dtl_idx))) + accumulate_stolen_time(); + } +#endif +} #endif /* __KERNEL__ */ #else /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ @@ -96,5 +107,8 @@ static inline void account_cpu_user_entry(void) static inline void account_cpu_user_exit(void) { } +static notrace inline void account_stolen_time(void) +{ +} #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ #endif /* __POWERPC_CPUTIME_H */ |