mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
tick/sched: Preserve number of idle sleeps across CPU hotplug events
commit9a574ea906
upstream. Commit71fee48f
("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:71fee48f
("tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug") Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240122233534.3094238-1-tim.c.chen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e333bbb557
commit
cf0b4ba4b0
1 changed files with 5 additions and 0 deletions
|
@ -1557,6 +1557,7 @@ void tick_cancel_sched_timer(int cpu)
|
|||
{
|
||||
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
|
||||
ktime_t idle_sleeptime, iowait_sleeptime;
|
||||
unsigned long idle_calls, idle_sleeps;
|
||||
|
||||
# ifdef CONFIG_HIGH_RES_TIMERS
|
||||
if (ts->sched_timer.base)
|
||||
|
@ -1565,9 +1566,13 @@ void tick_cancel_sched_timer(int cpu)
|
|||
|
||||
idle_sleeptime = ts->idle_sleeptime;
|
||||
iowait_sleeptime = ts->iowait_sleeptime;
|
||||
idle_calls = ts->idle_calls;
|
||||
idle_sleeps = ts->idle_sleeps;
|
||||
memset(ts, 0, sizeof(*ts));
|
||||
ts->idle_sleeptime = idle_sleeptime;
|
||||
ts->iowait_sleeptime = iowait_sleeptime;
|
||||
ts->idle_calls = idle_calls;
|
||||
ts->idle_sleeps = idle_sleeps;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue