Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp857721rdb; Fri, 20 Oct 2023 01:03:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiXKCK/pGFG6oL6X+XlovxnYKsy+VfQMp1FISRhASuNHuHVMkLVOx2IB9X1Zmbh2dZnJtE X-Received: by 2002:a17:90b:3717:b0:27d:98f3:21a7 with SMTP id mg23-20020a17090b371700b0027d98f321a7mr1094589pjb.8.1697789017243; Fri, 20 Oct 2023 01:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697789017; cv=none; d=google.com; s=arc-20160816; b=orxnm8ZFM9I49zVos1YyzlnogrfekxGcFSqqK4JV0E0Td78sD6ukwsUy0HgX8aIN88 fcY2iE2+jhTJcJguiOxQe2nWpaxvrBqADPqK5TzZIBwKrLoE364Kyvgoxlm4WorX1dsE BXI1Cg+DiuGqB0XVgkfb34KUhMFfDyTPjV5Gw83NxPF43Lk8y8RYKtaS8T5TqHgd7DGt LTOPQQTLci01oyNTxOYJgbzQiRMuLjL2OAm9fWGN02MHvrGP/pc62QAO9cY5/TbX2yHG eakDBoP+ya0CS2ZQwDSbPOKUQzvGEz3h4xzgKs6v6RF9mN38XrAoK9eA+lYhTfLT0uzp 4OhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=XBMo7rgZjOKemXx2HDqbfU2Qr3lejJI9GwbU6UPbrPA=; fh=npO1UBk2634eSE2r8XqvU8hlIJD+99ARLnmAga/U+4U=; b=ld9BbyDISp3WZ/5257XiunNWeSxv7J44NUuB/46YbqAApdJ4l1atyBaB/AeI1x29lL w9mqfqYMLRkqNTCwin/UQtJM9TdnyWpVH4An7OAtB6mGS7+apkfmTlBMNANtPIWIJ4QQ ydeayQ6WVawndRBHT6IjWIGGA/CNlqGjXRm7YCRuXCiaMVUzSilC388dSWBVcaX6tcXy c13LYV0x97j9bXLeobW8c4zcMdT0MFcK7VJ+EpvcDTeKQ/SHrXZS6tP8kcwuwlZo9TF6 FQY8bEjOaC4jnVtNq4WoZkPm4oKajCN8Mx/PS+oPWhhhxMAN6qNDWtq+EjSmEUxZl2t8 XsCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FQZpn6+N; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id cm13-20020a056a020a0d00b0059d25cedc71si1358529pgb.757.2023.10.20.01.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:03:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FQZpn6+N; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0BC2C826EC82; Fri, 20 Oct 2023 01:02:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376487AbjJTICP (ORCPT + 99 others); Fri, 20 Oct 2023 04:02:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376452AbjJTICG (ORCPT ); Fri, 20 Oct 2023 04:02:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D64FDD55; Fri, 20 Oct 2023 01:02:03 -0700 (PDT) Date: Fri, 20 Oct 2023 08:02:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697788922; 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: in-reply-to:in-reply-to:references:references; bh=XBMo7rgZjOKemXx2HDqbfU2Qr3lejJI9GwbU6UPbrPA=; b=FQZpn6+N0Tl1OafU3xH3c8/1mfGoF/YvjvLQkmYsprLZW5yvWwTALuqUdwh9OirmzdTrY1 Z9AOBeBUmrQUEgNcGfdFBVoGssit51EKZxsqa7yh2whihfz5hN4vbMReTOFCyWLdbKVxXD 0ejuC+7daaRV6e8HgmxNx45LUY5dwpQt6bsZ4nkUb/TvPj0/pcBPEtXmcSLEtwQtNOgOl2 oPlrTuK+0AZJVx3LRxMibx00TKYX9eeq3G+dCTBpRzlezE26ZD9x3KawShhoGdpO4OtKyp dPrP4L/bxBQKLL+ZQNFcxo0n1HEvGBcXhUXmQsqa2SGoJUq7VZsBzTrPLZqRhw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697788922; 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: in-reply-to:in-reply-to:references:references; bh=XBMo7rgZjOKemXx2HDqbfU2Qr3lejJI9GwbU6UPbrPA=; b=wHvEWka/rOK8A4Soy/ut4gUysk8vYw5MQikk2606TgXuu6wmhL+SYC9nhHY1z6UI/FfpjK H0zX4qP7lVlJQeAw== From: "tip-bot2 for Joel Fernandes (Google)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/nohz: Update comments about NEWILB_KICK Cc: "Joel Fernandes (Google)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231020014031.919742-2-joel@joelfernandes.org> References: <20231020014031.919742-2-joel@joelfernandes.org> MIME-Version: 1.0 Message-ID: <169778892143.3135.5766512330437156531.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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 20 Oct 2023 01:02:52 -0700 (PDT) The following commit has been merged into the sched/core branch of tip: Commit-ID: fb064e5ae1657595c090ebbc5b15787a3ef603e9 Gitweb: https://git.kernel.org/tip/fb064e5ae1657595c090ebbc5b15787a3ef603e9 Author: Joel Fernandes (Google) AuthorDate: Fri, 20 Oct 2023 01:40:27 Committer: Ingo Molnar CommitterDate: Fri, 20 Oct 2023 09:56:21 +02:00 sched/nohz: Update comments about NEWILB_KICK How ILB is triggered without IPIs is cryptic. Out of mercy for future code readers, document it in code comments. The comments are derived from a discussion with Vincent in a past review. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231020014031.919742-2-joel@joelfernandes.org --- kernel/sched/fair.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9ae2208..8c486ff 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12005,8 +12005,19 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) } /* - * Check if we need to run the ILB for updating blocked load before entering - * idle state. + * Check if we need to directly run the ILB for updating blocked load before + * entering idle state. Here we run ILB directly without issuing IPIs. + * + * Note that when this function is called, the tick may not yet be stopped on + * this CPU yet. nohz.idle_cpus_mask is updated only when tick is stopped and + * cleared on the next busy tick. In other words, nohz.idle_cpus_mask updates + * don't align with CPUs enter/exit idle to avoid bottlenecks due to high idle + * entry/exit rate (usec). So it is possible that _nohz_idle_balance() is + * called from this function on (this) CPU that's not yet in the mask. That's + * OK because the goal of nohz_run_idle_balance() is to run ILB only for + * updating the blocked load of already idle CPUs without waking up one of + * those idle CPUs and outside the preempt disable / irq off phase of the local + * cpu about to enter idle, because it can take a long time. */ void nohz_run_idle_balance(int cpu) {