Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310AbdFVLQ2 (ORCPT ); Thu, 22 Jun 2017 07:16:28 -0400 Received: from terminus.zytor.com ([65.50.211.136]:37745 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752827AbdFVLQ0 (ORCPT ); Thu, 22 Jun 2017 07:16:26 -0400 Date: Thu, 22 Jun 2017 04:11:53 -0700 From: tip-bot for Frederic Weisbecker Message-ID: Cc: riel@redhat.com, torvalds@linux-foundation.org, peterz@infradead.org, fweisbec@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org Reply-To: mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, riel@redhat.com, torvalds@linux-foundation.org, peterz@infradead.org, fweisbec@gmail.com In-Reply-To: <1497838322-10913-4-git-send-email-fweisbec@gmail.com> References: <1497838322-10913-4-git-send-email-fweisbec@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Spare idle load balancing on nohz_full CPUs Git-Commit-ID: 387bc8b5536eeb0a92f4b4ab553539eaea2ac0ba 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: 1756 Lines: 45 Commit-ID: 387bc8b5536eeb0a92f4b4ab553539eaea2ac0ba Gitweb: http://git.kernel.org/tip/387bc8b5536eeb0a92f4b4ab553539eaea2ac0ba Author: Frederic Weisbecker AuthorDate: Mon, 19 Jun 2017 04:12:02 +0200 Committer: Ingo Molnar CommitDate: Thu, 22 Jun 2017 11:30:02 +0200 sched/fair: Spare idle load balancing on nohz_full CPUs Although idle load balancing obviously only concerns idle CPUs, it can be a disturbance on a busy nohz_full CPU. Indeed a CPU can only get rid of an idle load balancing duty once a tick fires while it runs a task and this can take a while on a nohz_full CPU. We could fix that and escape the idle load balancing duty from the very idle exit path but that would bring unecessary overhead. Lets just not bother and leave that job to housekeeping CPUs (those outside nohz_full range). The nohz_full CPUs simply don't want any disturbance. Signed-off-by: Frederic Weisbecker Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1497838322-10913-4-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a24661a..694c258 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8683,6 +8683,10 @@ void nohz_balance_enter_idle(int cpu) if (!cpu_active(cpu)) return; + /* Spare idle load balancing on CPUs that don't want to be disturbed: */ + if (!is_housekeeping_cpu(cpu)) + return; + if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu))) return;