Skip to content

Commit

Permalink
sched/idle: Move quiet_vmstate() into the NOHZ code
Browse files Browse the repository at this point in the history
quiet_vmstat() is an expensive function that only makes sense when we
go into NOHZ.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: aubrey.li@linux.intel.com
Cc: cl@linux.com
Cc: fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
  • Loading branch information
Peter Zijlstra authored and vantoman committed Apr 19, 2020
1 parent b931595 commit 2397c18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/sched/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ static void do_idle(void)
*/

__current_set_polling();
quiet_vmstat();
tick_nohz_idle_enter();

while (!need_resched()) {
Expand Down
2 changes: 2 additions & 0 deletions kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/timer.h>
#include <linux/context_tracking.h>
#include <linux/rq_stats.h>
#include <linux/mm.h>

#include <asm/irq_regs.h>

Expand Down Expand Up @@ -823,6 +824,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
if (!ts->tick_stopped) {
calc_load_nohz_start();
cpu_load_update_nohz_start();
quiet_vmstat();

ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
ts->tick_stopped = 1;
Expand Down

0 comments on commit 2397c18

Please sign in to comment.