Message ID | 169999903219.391.2460827173392775023.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a59:b0:164:83eb:24d7 with SMTP id 25csp2226682rwb; Tue, 14 Nov 2023 13:57:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfxbtQ6tPZn3c1JoGqbSioqW6MhHtiAzUwOi2+wp8tGg1LVzPc79kk4o4tqNn2plzw5ult X-Received: by 2002:a17:90b:4f4e:b0:281:3a4:2220 with SMTP id pj14-20020a17090b4f4e00b0028103a42220mr10481430pjb.36.1699999065206; Tue, 14 Nov 2023 13:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699999065; cv=none; d=google.com; s=arc-20160816; b=QGbtZ2pCiHwKMWBhxUIt5vWy0F92uE4mPzziUmtC8WHRnB+Xt2STZCTPpsw83cMjq8 BzRdkxb/JfjRpUgMxllf23cS+WN8c2GGcb3iittWbLfr0s9gHrz3czS+wv4obBhZvdiY mrGoh1dl3Wqdi0pzEtNANLIPHJ6eKMZYD03izMmPqcZ6dPDgQpdxzx9QGirQYdhJzL/N mw4mfznLHPK4eY06kKmYXECoQ1ech1Qb2CUGYfe0K5S2UlVGDZx3rfBO9Z9RLegq505l pIE4lGLJcLQONVO2AdrXMT/yGHNYh8scNY33Z1e9wcsYNT/X1UaFH8OgXpFF06/SGTTJ oNfg== 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=0qSSd9FGW8BlweZLwt59poRN99tZZYZnkIbBfiqtXHI=; fh=YErCt0VkcaoSoVtVnjsnWFGJBPRT98msp7ou+5N27Xc=; b=wUcmWNEG2syOGveC67BUnPJ0XdpUxfMfmKtbGqyklFbnhpRvNr2dhOtmNpVkd6j65e Aq4BgqOhtKrnNRCbxkQHxrgcDR8EU/vcrGzi1cSB2LA4ohyfDcBTSkQzfJpdl2b5D7CZ 9rBLzT++OqtZCOuXYIyQN1XWSw/rtbAnbMQYDoj2mzriyv/pBtvq0YBEqSZSs7qxC4T6 /9Z9Tj9z1b0RYoRby+S1DdQz9CHWqOTcT2G94/wzAuqVzqH6Se7ehWCffpdhbH9RGHDl ok5hbf7NBf/bR9mlwllgWTFy3uyO/Db/9vKg5t6QyUeEP1sl/IbB3g5HXShN1wIZCStv lFNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EXz8nN4l; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id in7-20020a17090b438700b002773af24826si13179123pjb.123.2023.11.14.13.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 13:57:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EXz8nN4l; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 5510680B132F; Tue, 14 Nov 2023 13:57:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234121AbjKNV5T (ORCPT <rfc822;lhua1029@gmail.com> + 29 others); Tue, 14 Nov 2023 16:57:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233991AbjKNV5R (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Nov 2023 16:57:17 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36281D8; Tue, 14 Nov 2023 13:57:14 -0800 (PST) Date: Tue, 14 Nov 2023 21:57:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1699999032; 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=0qSSd9FGW8BlweZLwt59poRN99tZZYZnkIbBfiqtXHI=; b=EXz8nN4lwTCkPnTLjh0eUYjFGxBPOb5vvCYrTTN4d4JOMPxd84xvwjv7Lx87NdDQnqifq+ B3dQ6byB2uatTb4N6o41GJ+iWE4H7ZRT/D3JpEUGdXNT+6zuMUiyxwHgydiF0cbjuCbraY 4eoDyE7ntt4Mr3uBNjyns4X8v0OdmTbbxObusibDQvMgJMNYH4qYOmOyZkugk3Vy/R9rGj BYNznUCPckAdgjA+wGwGdSL++QJxWoV6QkLVr6gtgnIUUI4CXwv9PMkccX4sJ9Atu3lFJB kmWCdWXcfmyaKT1nvuYy7XQOyPtgZrBhDs/P+Og7q9FZWXJhUnxQ7o8t3zw97A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1699999032; 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=0qSSd9FGW8BlweZLwt59poRN99tZZYZnkIbBfiqtXHI=; b=4RH8QeqL91d3kCvARfa1ThU///aQZwW+Mhf5qvbUtDu1LpBZkaGaTjH+g0dNddAO7ixVLI Dvde76QgF4tiiDBw== From: "tip-bot2 for Keisuke Nishimura" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/fair: Fix the decision for load balance Cc: Keisuke Nishimura <keisuke.nishimura@inria.fr>, "Peter Zijlstra (Intel)" <peterz@infradead.org>, Chen Yu <yu.c.chen@intel.com>, Shrikanth Hegde <sshegde@linux.vnet.ibm.com>, Vincent Guittot <vincent.guittot@linaro.org>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231031133821.1570861-1-keisuke.nishimura@inria.fr> References: <20231031133821.1570861-1-keisuke.nishimura@inria.fr> MIME-Version: 1.0 Message-ID: <169999903219.391.2460827173392775023.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 14 Nov 2023 13:57:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781278560755323860 X-GMAIL-MSGID: 1782578220017160444 |
Series |
[tip:,sched/urgent] sched/fair: Fix the decision for load balance
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Nov. 14, 2023, 9:57 p.m. UTC
The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 6d7e4782bcf549221b4ccfffec2cf4d1a473f1a3 Gitweb: https://git.kernel.org/tip/6d7e4782bcf549221b4ccfffec2cf4d1a473f1a3 Author: Keisuke Nishimura <keisuke.nishimura@inria.fr> AuthorDate: Tue, 31 Oct 2023 14:38:22 +01:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 14 Nov 2023 22:27:01 +01:00 sched/fair: Fix the decision for load balance should_we_balance is called for the decision to do load-balancing. When sched ticks invoke this function, only one CPU should return true. However, in the current code, two CPUs can return true. The following situation, where b means busy and i means idle, is an example, because CPU 0 and CPU 2 return true. [0, 1] [2, 3] b b i b This fix checks if there exists an idle CPU with busy sibling(s) after looking for a CPU on an idle core. If some idle CPUs with busy siblings are found, just the first one should do load-balancing. Fixes: b1bfeab9b002 ("sched/fair: Consider the idle state of the whole core for load balance") Signed-off-by: Keisuke Nishimura <keisuke.nishimura@inria.fr> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Chen Yu <yu.c.chen@intel.com> Reviewed-by: Shrikanth Hegde <sshegde@linux.vnet.ibm.com> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org> Link: https://lkml.kernel.org/r/20231031133821.1570861-1-keisuke.nishimura@inria.fr --- kernel/sched/fair.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 025d909..d7a3c63 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11184,12 +11184,16 @@ static int should_we_balance(struct lb_env *env) continue; } - /* Are we the first idle CPU? */ + /* + * Are we the first idle core in a non-SMT domain or higher, + * or the first idle CPU in a SMT domain? + */ return cpu == env->dst_cpu; } - if (idle_smt == env->dst_cpu) - return true; + /* Are we the first idle CPU with busy siblings? */ + if (idle_smt != -1) + return idle_smt == env->dst_cpu; /* Are we the first CPU of this group ? */ return group_balance_cpu(sg) == env->dst_cpu;