Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdFVLP7 (ORCPT ); Thu, 22 Jun 2017 07:15:59 -0400 Received: from terminus.zytor.com ([65.50.211.136]:51563 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719AbdFVLP5 (ORCPT ); Thu, 22 Jun 2017 07:15:57 -0400 Date: Thu, 22 Jun 2017 04:11:18 -0700 From: tip-bot for Frederic Weisbecker Message-ID: Cc: mingo@kernel.org, peterz@infradead.org, fweisbec@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, riel@redhat.com, torvalds@linux-foundation.org Reply-To: mingo@kernel.org, peterz@infradead.org, riel@redhat.com, torvalds@linux-foundation.org, fweisbec@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <1497838322-10913-3-git-send-email-fweisbec@gmail.com> References: <1497838322-10913-3-git-send-email-fweisbec@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] nohz: Move idle balancer registration to the idle path Git-Commit-ID: a0db971e4eb69fc84eb3d7ef94f718b483550b4a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 52 Commit-ID: a0db971e4eb69fc84eb3d7ef94f718b483550b4a Gitweb: http://git.kernel.org/tip/a0db971e4eb69fc84eb3d7ef94f718b483550b4a Author: Frederic Weisbecker AuthorDate: Mon, 19 Jun 2017 04:12:01 +0200 Committer: Ingo Molnar CommitDate: Thu, 22 Jun 2017 11:30:01 +0200 nohz: Move idle balancer registration to the idle path The idle load balancing registration path assumes that we only stop the tick when the CPU is idle, ignoring the nohz full case. As a result, a nohz full CPU that is running a task may be chosen to perform idle load balancing. Lets make sure that only CPUs in dynticks idle mode can be picked as idle load balancers. Signed-off-by: Frederic Weisbecker Acked-by: Rik van Riel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1497838322-10913-3-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- kernel/time/tick-sched.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index b1b58a0..db023e9 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -782,7 +782,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, * the scheduler tick in nohz_restart_sched_tick. */ if (!ts->tick_stopped) { - nohz_balance_enter_idle(cpu); calc_load_nohz_start(); cpu_load_update_nohz_start(); @@ -923,8 +922,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts) ts->idle_expires = expires; } - if (!was_stopped && ts->tick_stopped) + if (!was_stopped && ts->tick_stopped) { ts->idle_jiffies = ts->last_jiffies; + nohz_balance_enter_idle(cpu); + } } }