From patchwork Fri Mar 1 11:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 208796 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp1010244dyb; Fri, 1 Mar 2024 03:27:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWdXfRc4MOA8Zs5nzrtdblV38BkHovUw0yqyGc5VZ3elyY+M7rVaA+Bed1HA6CweZgeifQMmHlJSXemlZzKxNpW2URMbA== X-Google-Smtp-Source: AGHT+IG9uHzmzT+de2vpnS9C9tLd6pwQLVsYTPv+aMtrWJtw0VQwjIqfAGP8KPetaQYKzaXxf1YO X-Received: by 2002:a17:906:364d:b0:a42:e756:23ef with SMTP id r13-20020a170906364d00b00a42e75623efmr1266996ejb.7.1709292439369; Fri, 01 Mar 2024 03:27:19 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w7-20020a170906480700b00a4410598ee9si1363727ejq.597.2024.03.01.03.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:27:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88338-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=OfToHa5f; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-88338-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88338-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0282A1F22E7C for ; Fri, 1 Mar 2024 11:27:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0876B6CDB8; Fri, 1 Mar 2024 11:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OfToHa5f" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B2506CDA0 for ; Fri, 1 Mar 2024 11:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709292413; cv=none; b=hw7zgIM3aCXdd3aBW7qPwgzBxKdkz4Z67RXa18zq/4dhXcNfEwM+yG/RR5/PjePwj4Wh2nstPVU1S2eDxJZt1tFST2f/o7334EG5lStgmmERdPqvgIVkxBICDeN4MlQ+FbWofCc7gmPKHhVsFX+ZO3ic4SSBHm/ynK8lnkze7AU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709292413; c=relaxed/simple; bh=kCj9Rovdwbcq2XlKGpXJo3zaiI60tfXSBC3dJ5D5Ut8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=STku+b/Xv29Re+KvzVtygkcWc/Kbyk3kjVgocBzZqjauHXy+H03XqxXMMBPKoJPL6iBy/13zq5TK1klCigwqg9+RyBdngoECvPLbvJucARmszQtznwG5NP98GZWBPDZqgTwuZEQHo8bA6K2cK5Kcv2XZxFU963KUL3WL+V0mQEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OfToHa5f; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d29aad15a5so22752201fa.3 for ; Fri, 01 Mar 2024 03:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709292409; x=1709897209; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=nzH3P5qMQroNOdQTSOHArHxI7GPz6QqJAEyL6agayJ0=; b=OfToHa5fyhmYvzzmZ196DfP5CLlVii3Yht+NWDYoiwa8h6K3tz7HO1ec8OAc170OfB MktcxSPEyVi+8aVTy1Dwmgf18Og1q5d/DWUaH+tA9yjlXlSlax+auf4VjM9U1uxYJpX/ 2MrJtSSaTxRlJbKeb9roKaMYLq8umlk/NN1hE9Mg4DiKHDR9uE7yJVXtS5zaIwhV8ez2 /y+JRVMaDeC97W/cJ8ZzZ0koQKUD0yZ3nSsrbbr2gxwLiEWDKALO/IQAqb5KZKlr6apg TFkLj2UkhdJOxu/32DiIRU0yAIwZt0Pc00ELxdBLhTIDBcYB6jK/pY0I5Zwrrhj7FNQs oe+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709292409; x=1709897209; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nzH3P5qMQroNOdQTSOHArHxI7GPz6QqJAEyL6agayJ0=; b=H5BQeeBT+uKD0ITxFUBChRJdPVTU5voW7osqXOlRaCmg2iNf9TgKs2EoW2l0kYy7W2 VBB6csfkvHwnFbgUUulx5hvUFV7EMVUfaSNy415lmcarueIolNpb4WLbxqwyFEdlcg0s 2eeRsmbgZ0xAZ5mho5CbcgCybffsdEfcrGT03xVI3vsj5zJI8Zazs4Gg/sIPd3TFrPQH GsuHd+KqbUxHowFf1r/DPfH1YGhMlB7k3C4HJvchFArOx7fwmluE4Jocb5ImwHNbVBjY NZcTshqpSeni4DbZgcZxVnvkkh6LBDz+1nRLX5tcsjnWyVMHuAFlADDZaBO2VjsB57cK eqZA== X-Gm-Message-State: AOJu0YxRLyhMjDIvJpilIiLE7j4HRyjoZN8rYFTwcqjooHGiWlOE1d/C 97QhSFnLSBxmzBHAaTxxy2P5UdzG4tYrI/MDoJnRFCkU9sTdPwT3DIYz+RZtHrs= X-Received: by 2002:a2e:a409:0:b0:2d3:4bef:45fd with SMTP id p9-20020a2ea409000000b002d34bef45fdmr358257ljn.33.1709292409318; Fri, 01 Mar 2024 03:26:49 -0800 (PST) Received: from gmail.com (1F2EF13F.nat.pool.telekom.hu. [31.46.241.63]) by smtp.gmail.com with ESMTPSA id f12-20020a05600c4e8c00b00412ad64cc69sm5068102wmq.29.2024.03.01.03.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:26:48 -0800 (PST) Sender: Ingo Molnar Date: Fri, 1 Mar 2024 12:26:46 +0100 From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Linus Torvalds , Valentin Schneider Subject: [PATCH 5/7 v2] sched/balancing: Update run_rebalance_domains() comments Message-ID: References: <20240301110951.3707367-1-mingo@kernel.org> <20240301110951.3707367-6-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240301110951.3707367-6-mingo@kernel.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792322027952387514 X-GMAIL-MSGID: 1792323028912394295 The first sentence of the comment explaining run_rebalance_domains() is historic and not true anymore: * run_rebalance_domains is triggered when needed from the scheduler tick. .. contradicted/modified by the second sentence: * Also triggered for NOHZ idle balancing (with NOHZ_BALANCE_KICK set). Avoid that kind of confusion straight away and explain from what places sched_balance_softirq() is triggered. Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Linus Torvalds Cc: Valentin Schneider --- kernel/sched/fair.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4c46bffb6a7a..18b7d2999cff 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12409,8 +12409,13 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) } /* - * run_rebalance_domains is triggered when needed from the scheduler tick. - * Also triggered for NOHZ idle balancing (with NOHZ_BALANCE_KICK set). + * The run_rebalance_domains() softirq handler is triggered via SCHED_SOFTIRQ + * from two places: + * + * - the scheduler_tick(), + * + * - from the SMP cross-call function nohz_csd_func(), + * used by NOHZ idle balancing (with NOHZ_BALANCE_KICK set). */ static __latent_entropy void run_rebalance_domains(struct softirq_action *h) {