linux-stable/arch
Mete Durlu 4b9d72498d s390/vtime: fix average steal time calculation
[ Upstream commit 367c50f784 ]

Current average steal timer calculation produces volatile and inflated
values. The only user of this value is KVM so far and it uses that to
decide whether or not to yield the vCPU which is seeing steal time.
KVM compares average steal timer to a threshold and if the threshold
is past then it does not allow CPU polling and yields it to host, else
it keeps the CPU by polling.
Since KVM's steal time threshold is very low by default (%10) it most
likely is not effected much by the bloated average steal timer values
because the operating region is pretty small. However there might be
new users in the future who might rely on this number. Fix average
steal timer calculation by changing the formula from:

	avg_steal_timer = avg_steal_timer / 2 + steal_timer;

to the following:

	avg_steal_timer = (avg_steal_timer + steal_timer) / 2;

This ensures that avg_steal_timer is actually a naive average of steal
timer values. It now closely follows steal timer values but of course
in a smoother manner.

Fixes: 152e9b8676 ("s390/vtime: steal time exponential moving average")
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:21:35 -04:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:22:03 +02:00
arc ARC: fix spare error 2024-01-25 14:52:30 -08:00
arm crypto: arm/sha - fix function cast warnings 2024-03-26 18:21:29 -04:00
arm64 arm64: dts: broadcom: bcmbca: bcm4908: drop invalid switch cells 2024-03-26 18:21:34 -04:00
csky arch: consolidate arch_irq_work_raise prototypes 2024-02-23 08:54:39 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: Fix function name in die() 2023-02-01 08:27:20 +01:00
ia64 memblock: allow to specify flags with memblock_add_node() 2023-12-20 15:17:33 +01:00
m68k memblock: allow to specify flags with memblock_add_node() 2023-12-20 15:17:33 +01:00
microblaze
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:21:12 -04:00
nds32
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-11 23:00:37 +09:00
parisc parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check 2024-03-26 18:21:13 -04:00
powerpc powerpc/embedded6xx: Fix no previous prototype for avr_uart_send() etc. 2024-03-26 18:21:31 -04:00
riscv riscv: dts: sifive: add missing #interrupt-cells to pmic 2024-03-26 18:21:12 -04:00
s390 s390/vtime: fix average steal time calculation 2024-03-26 18:21:35 -04:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:08:23 +01:00
sparc sparc32: Fix section mismatch in leon_pci_grpci 2024-03-26 18:21:32 -04:00
um um: time-travel: fix time corruption 2024-02-23 08:54:50 +01:00
x86 x86, relocs: Ignore relocations in .notes section 2024-03-26 18:21:21 -04:00
xtensa xtensa: boot/lib: fix function prototypes 2023-10-06 13:18:14 +02:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-02-23 08:55:02 +01:00