From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbdFSCMP (ORCPT ); Sun, 18 Jun 2017 22:12:15 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36836 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbdFSCML (ORCPT ); Sun, 18 Jun 2017 22:12:11 -0400 From: Frederic Weisbecker To: Peter Zijlstra Cc: LKML , Frederic Weisbecker , Rik van Riel , Thomas Gleixner , Ingo Molnar Subject: [PATCH 3/3] sched: Spare idle load balancing on nohz_full CPUs Date: Mon, 19 Jun 2017 04:12:02 +0200 Message-Id: <1497838322-10913-4-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497838322-10913-1-git-send-email-fweisbec@gmail.com> References: <1497838322-10913-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Although idle load balancing obviously only concern 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 in 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: Thomas Gleixner Cc: Ingo Molnar Cc: Rik van Riel Cc: Peter Zijlstra --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d711093..cfca960 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8659,6 +8659,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; -- 2.7.4