Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 500ad5d

Browse files
pdxChengregkh
authored andcommitted
tick/sched: Preserve number of idle sleeps across CPU hotplug events
commit 9a574ea upstream. Commit 71fee48 ("tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug") preserved total idle sleep time and iowait sleeptime across CPU hotplug events. Similar reasoning applies to the number of idle calls and idle sleeps to get the proper average of sleep time per idle invocation. Preserve those fields too. Fixes: 71fee48 ("tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug") Signed-off-by: Tim Chen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent af7ab5d commit 500ad5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/time/tick-sched.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ void tick_cancel_sched_timer(int cpu)
15481548
{
15491549
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
15501550
ktime_t idle_sleeptime, iowait_sleeptime;
1551+
unsigned long idle_calls, idle_sleeps;
15511552

15521553
# ifdef CONFIG_HIGH_RES_TIMERS
15531554
if (ts->sched_timer.base)
@@ -1556,9 +1557,13 @@ void tick_cancel_sched_timer(int cpu)
15561557

15571558
idle_sleeptime = ts->idle_sleeptime;
15581559
iowait_sleeptime = ts->iowait_sleeptime;
1560+
idle_calls = ts->idle_calls;
1561+
idle_sleeps = ts->idle_sleeps;
15591562
memset(ts, 0, sizeof(*ts));
15601563
ts->idle_sleeptime = idle_sleeptime;
15611564
ts->iowait_sleeptime = iowait_sleeptime;
1565+
ts->idle_calls = idle_calls;
1566+
ts->idle_sleeps = idle_sleeps;
15621567
}
15631568
#endif
15641569

0 commit comments

Comments
 (0)