linux-stable/arch
Mete Durlu abc9b13fd9 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:20:59 -04:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
arm crypto: arm/sha - fix function cast warnings 2024-03-26 18:20:50 -04:00
arm64 arm64: dts: broadcom: bcmbca: bcm4908: drop invalid switch cells 2024-03-26 18:20:58 -04:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch: Disable IRQ before init_fn() for nonboot CPUs 2024-03-01 13:26:31 +01:00
m68k m68k: Fix invalid .section syntax 2023-09-13 09:42:21 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:20:24 -04:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check 2024-03-26 18:20:25 -04:00
powerpc powerpc/embedded6xx: Fix no previous prototype for avr_uart_send() etc. 2024-03-26 18:20:52 -04:00
riscv riscv: dts: sifive: add missing #interrupt-cells to pmic 2024-03-26 18:20:25 -04:00
s390 s390/vtime: fix average steal time calculation 2024-03-26 18:20:59 -04:00
sh sh: bios: Revive earlyprintk support 2023-11-20 11:52:07 +01:00
sparc sparc32: Fix section mismatch in leon_pci_grpci 2024-03-26 18:20:53 -04:00
um um: Fix adding '-no-pie' for clang 2024-02-23 09:12:38 +01:00
x86 perf/x86/amd/core: Avoid register reset when CPU is dead 2024-03-26 18:20:56 -04:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:12:28 +01:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-02-23 09:12:32 +01:00