linux/kernel/time
Stian Halseth 96a494c9cf sched/cputime: Don't account idle time twice after dyntick-idle
On idle exit the dyntick-idle accounting accounts the time up to now,
then the tick is restarted on its old period. The first tick accounts a
whole TICK_NSEC to whatever runs, although the part of that period
before the idle exit has just been accounted as idle time, or with
IRQ_TIME_ACCOUNTING as IRQ time. That is up to a full tick per idle
exit, and /proc/stat reports more idle time than wall time.

Record how much of the current tick period dyntick-idle has accounted,
and leave it out of the tick that ends the period.

Fixes: cf6444c3e1 ("tick/sched: Unify idle cputime accounting")
Signed-off-by: Stian Halseth <stian@itx.no>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/all/20261004142724.3896396-1-stian@itx.no/
Link: https://patch.msgid.link/20261007142950.547604-1-stian@itx.no
2026-10-16 09:49:03 +02:00
..
.kunitconfig time/kunit: Add .kunitconfig 2026-02-24 08:41:51 +01:00
alarmtimer.c alarmtimer: Remove stale return description from alarm_handle_timer() 2026-05-06 08:33:08 +02:00
clockevents.c tick/broadcast: Plug clockevents replacement race 2026-09-07 11:10:20 +02:00
clocksource-wdtest.c clocksource: Rewrite watchdog code completely 2026-03-20 13:36:32 +01:00
clocksource.c clocksource: Unregister subsystem on device registration failure 2026-07-07 23:26:58 +02:00
hrtimer.c hrtimer: Use hard expiry when updating timers on the same base 2026-09-11 10:15:42 +02:00
itimer.c timers/itimer: Zero-init old itimerval before copy to userspace 2026-08-11 15:43:12 +02:00
jiffies.c sysctl: Fix type truncation in sysctl_msec_to_jiffies 2026-09-15 09:20:58 +02:00
Kconfig nohz: Replace dead select with choice default 2026-08-11 15:37:23 +02:00
Makefile timens: Remove dependency on the vDSO 2026-03-26 15:44:23 +01:00
namespace_internal.h timens: Remove dependency on the vDSO 2026-03-26 15:44:23 +01:00
namespace_vdso.c vdso/datastore: Explicitly prevent remote access to timens vvar page 2026-07-07 23:52:52 +02:00
namespace.c time/namespace: Validate nanosecond field in proc_timens_set_offset() 2026-07-07 23:26:58 +02:00
ntp_internal.h timekeeping: Drive time_offset skew via per-tick ntp_error transfer 2026-07-10 09:20:54 +02:00
ntp.c ntp: Remove tick_length_base, use tick_length directly 2026-07-10 09:20:55 +02:00
posix-clock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
posix-cpu-timers.c posix-cpu-timers: Prevent freeing a timer which is queued on the expiry list 2026-09-19 22:56:22 +02:00
posix-stubs.c
posix-timers.c posix-timers: Switch to hrtimer_start_expires_user() 2026-05-01 21:36:12 +02:00
posix-timers.h posix-timers: Expand timer_[re]arm() callbacks with a boolean return value 2026-05-01 21:36:11 +02:00
sched_clock.c
sleep_timeout.c
test_udelay.c
tick-broadcast-hrtimer.c clockevents: Remove redundant CLOCK_EVT_FEAT_KTIME 2026-02-27 16:40:06 +01:00
tick-broadcast.c tick/broadcast: Plug clockevents replacement race 2026-09-07 11:10:20 +02:00
tick-common.c clockevents: Prevent timer interrupt starvation 2026-04-10 22:45:38 +02:00
tick-internal.h tick/broadcast: Plug clockevents replacement race 2026-09-07 11:10:20 +02:00
tick-legacy.c
tick-oneshot.c
tick-sched.c sched/cputime: Don't account idle time twice after dyntick-idle 2026-10-16 09:49:03 +02:00
tick-sched.h tick/sched: Remove unused fields 2026-06-02 21:27:25 +02:00
time_test.c
time.c VDSO updates: 2026-08-18 16:56:25 -07:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c
timekeeping_internal.h timekeeping: Move the vDSO update declarations into a private header 2026-07-07 23:48:08 +02:00
timekeeping.c timekeeping: Use u32 for clock_was_set_seq 2026-08-11 18:11:20 +02:00
timekeeping.h timekeeping: Use u32 for clock_was_set_seq 2026-08-11 18:11:20 +02:00
timer_list.c timer_list: Use ktime_t over nanoseconds 2026-08-11 18:11:20 +02:00
timer_migration.c timers/migration: Fix memory leak in tmigr_setup_groups() error path 2026-07-07 23:26:58 +02:00
timer_migration.h timers/migration: Fix bad line kernel-doc warning in struct tmigr_cpu 2026-07-20 16:07:39 +02:00
timer.c timer: Keep debugobjects state consistent in migrate_timer_list() 2026-08-18 10:51:43 +02:00
vsyscall.c