From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46A5FC55178 for ; Thu, 29 Oct 2020 10:52:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCB3520731 for ; Thu, 29 Oct 2020 10:52:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Sg7FMWvp"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UhTLVYt4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727313AbgJ2Kwc (ORCPT ); Thu, 29 Oct 2020 06:52:32 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:60782 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727055AbgJ2Kvu (ORCPT ); Thu, 29 Oct 2020 06:51:50 -0400 Date: Thu, 29 Oct 2020 10:51:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603968708; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5SejojEcxaW3DEy/Oi7n0gFcnZbOoAuhMAMFANUr28=; b=Sg7FMWvpp10hy4r5Cq7ubukSRyvmlRVLhab5ou2oh7lP4B/ZzJdzfD7lTbefQZdbg1mUyh 6vUUwWqmnOG8pD9Q2aLa4c/GdOmuHzKDAz61i38P07EWVKIBfyHdBKapgRvhOK8PUHT46R p8l5TmyDLivY+9et30Qy5ye1PN72u8wvWF4NArXAqKyGp1E/ZPCsr16APsjFlnpWIswnUw 4w/VscFKSwu+JwIRoqN94Z9n5tTw2yKv4++ntD8WBgvKdc72rOFRsUaLZ5AdiGBhVLEUnM V1pzXgekGC2lyeEbS3x/BNhDL7LrnWlN11RJdBvDY8hI8JyIle1spHDAjBpnEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603968708; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z5SejojEcxaW3DEy/Oi7n0gFcnZbOoAuhMAMFANUr28=; b=UhTLVYt4bxK/hfa3fpZs/i5VKjznfLgT6hVsoJaaBCd2FXlEGrnqfixyw6ZVzlhUl8d+sh 4hKYOMHRitvlYhCw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/fair: Exclude the current CPU from find_new_ilb() Cc: "Peter Zijlstra (Intel)" , x86 , LKML MIME-Version: 1.0 Message-ID: <160396870806.397.17543198051603219100.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 45da7a2b0af8fa29dff2e6ba8926322068350fce Gitweb: https://git.kernel.org/tip/45da7a2b0af8fa29dff2e6ba8926322068350fce Author: Peter Zijlstra AuthorDate: Tue, 18 Aug 2020 10:48:17 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 29 Oct 2020 11:00:30 +01:00 sched/fair: Exclude the current CPU from find_new_ilb() It is possible for find_new_ilb() to select the current CPU, however, this only happens from newidle balancing, in which case need_resched() will be true, and consequently nohz_csd_func() will not trigger the softirq. Exclude the current CPU from becoming an ILB target. Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b9368d1..cd9a37c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10056,6 +10056,10 @@ static inline int find_new_ilb(void) for_each_cpu_and(ilb, nohz.idle_cpus_mask, housekeeping_cpumask(HK_FLAG_MISC)) { + + if (ilb == smp_processor_id()) + continue; + if (idle_cpu(ilb)) return ilb; }