mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-01 13:56:34 +00:00
The idle time reported in /proc/stat sometimes incorrectly contains huge values on s390. This is caused by a bug in arch_cpu_idle_time(). The kernel tries to figure out when a different cpu entered idle by accessing its per-cpu data structure. There is an ordering problem: if the remote cpu has an idle_enter value which is not zero, and an idle_exit value which is zero, it is assumed it is idle since "now". The "now" timestamp however is taken before the idle_enter value is read. Which in turn means that "now" can be smaller than idle_enter of the remote cpu. Unconditionally subtracting idle_enter from "now" can thus lead to a negative value (aka large unsigned value). Fix this by moving the get_tod_clock() invocation out of the loop. While at it also make the code a bit more readable. A similar bug also exists for show_idle_time(). Fix this is as well. Cc: <stable@vger.kernel.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> |
||
|---|---|---|
| .. | ||
| syscalls | ||
| vdso32 | ||
| vdso64 | ||
| .gitignore | ||
| alternative.c | ||
| asm-offsets.c | ||
| audit.c | ||
| audit.h | ||
| base.S | ||
| cache.c | ||
| compat_audit.c | ||
| compat_linux.c | ||
| compat_linux.h | ||
| compat_ptrace.h | ||
| compat_signal.c | ||
| cpcmd.c | ||
| crash_dump.c | ||
| debug.c | ||
| diag.c | ||
| dis.c | ||
| dumpstack.c | ||
| early_printk.c | ||
| early.c | ||
| ebcdic.c | ||
| entry.h | ||
| entry.S | ||
| fpu.c | ||
| ftrace.c | ||
| guarded_storage.c | ||
| head64.S | ||
| idle.c | ||
| ima_arch.c | ||
| ipl_vmparm.c | ||
| ipl.c | ||
| irq.c | ||
| jump_label.c | ||
| kdebugfs.c | ||
| kexec_elf.c | ||
| kexec_image.c | ||
| kprobes.c | ||
| lgr.c | ||
| machine_kexec_file.c | ||
| machine_kexec_reloc.c | ||
| machine_kexec.c | ||
| Makefile | ||
| mcount.S | ||
| module.c | ||
| nmi.c | ||
| nospec-branch.c | ||
| nospec-sysfs.c | ||
| os_info.c | ||
| perf_cpum_cf_common.c | ||
| perf_cpum_cf_diag.c | ||
| perf_cpum_cf_events.c | ||
| perf_cpum_cf.c | ||
| perf_cpum_sf.c | ||
| perf_event.c | ||
| perf_regs.c | ||
| pgm_check.S | ||
| process.c | ||
| processor.c | ||
| ptrace.c | ||
| reipl.S | ||
| relocate_kernel.S | ||
| runtime_instr.c | ||
| setup.c | ||
| signal.c | ||
| smp.c | ||
| stacktrace.c | ||
| sthyi.c | ||
| suspend.c | ||
| swsusp.S | ||
| sys_s390.c | ||
| sysinfo.c | ||
| time.c | ||
| topology.c | ||
| trace.c | ||
| traps.c | ||
| unwind_bc.c | ||
| uprobes.c | ||
| vdso.c | ||
| vmlinux.lds.S | ||
| vtime.c | ||