From patchwork Mon Jul 10 08:13:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 117708 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4873180vqx; Mon, 10 Jul 2023 01:36:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHaFnnyFeOKyaePcRFACt/pWwsTBw/WVPPRc7utjJBGkRf3YBqc1r/COnaMAonN4Xn5CYaC X-Received: by 2002:a05:6a20:d5:b0:131:c760:2a0b with SMTP id 21-20020a056a2000d500b00131c7602a0bmr2065196pzh.52.1688978182100; Mon, 10 Jul 2023 01:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688978182; cv=none; d=google.com; s=arc-20160816; b=ioLRaKmRdgTccWFax2ktqx5QIInwGfQ+EGiM2iRYjYF/2BTEIKBAr+fkcLFNr1CauN DO4XjSG8U7dSAWx5cwYFJbipPlFFrwWBf/yGtkGH6llDOE2h7CGxVQVHcehSvsDGGVfk +8sYWk7OG90UeEFjF0MCHnDcjTmRMG7JqtNexkmhhsnZOkm6YIPC2VdXROHmrAQtjDp0 lk6+nda2VDgrGuzUK/LnBiZtZpTkWfRRh/amvwQNgfRCnP1cmqgrpjOjMJk0RukJr1q2 AbteHbs/BeXS4Zrm6y6YclO/pNEaSBzSIHsq2XkJMuU5MbyIskAVEL49DLTpT6wsvT7V YQjg== 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=mjzAB0fzsGtpLPet2sHs0gH5HogT3zoQ1G1ZId/Omvc=; fh=8vzAMXynLdSXy0A8izRChlBoxJo6M931t0lvPJsZc+k=; b=Qv/apdR8oYE96IfB2eTftfFfSjElflbqNa6RNL/m0McMtx7McuhGc+nCFD06OM+oTG zTdYZ2i3hW8sgU5JbBrDfyUPsWxpHhVmRYrm6ckKK2+DAsYgNVN63glIYRgtRkes5N/Z ZghEVhddKWJgpsdr/1tr9W5oPJ3CDkO+JeiYtwFa2R28jYiwzbsjGCwsZKvy6Vyerjbs JH4qO5rE+rwGrX7BrxTnz8pcrGJY5rw1GBko42+CiP29GCwg1vesu9rsJqzAc9yQQbHZ lLb4LmjY9FOwvexTjpZv+k6pkH3wM/zhGB4AcR6bdYHplk3nPSGFGnQ+9UCFwRlQvajF /3sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QqvMu0qV; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju4-20020a170903428400b001b8b37f6b46si8124871plb.556.2023.07.10.01.36.09; Mon, 10 Jul 2023 01:36:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QqvMu0qV; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232759AbjGJIOH (ORCPT + 99 others); Mon, 10 Jul 2023 04:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232937AbjGJINq (ORCPT ); Mon, 10 Jul 2023 04:13:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C038E1; Mon, 10 Jul 2023 01:13:45 -0700 (PDT) Date: Mon, 10 Jul 2023 08:13:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1688976823; 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=mjzAB0fzsGtpLPet2sHs0gH5HogT3zoQ1G1ZId/Omvc=; b=QqvMu0qV9yQz/8lmSuyoMvW8CniVz7MqDKJHugsPJRcgH5qJlJXLhUIMyr635+1ttf5H3v BehgWj+fNFsXqg/R6SPaQE7bwapE+afek/MADOTgTx1JUon8ZUYnhStWH7tP+VlCbDo5T6 rslFN5+eRUr38a1Ha7LaMX2s0ZUy8lpR+sJOIeNlxt+Tyh5Gx3h8eoVUCrEg2B4p49KcPY 35GaHuNAUrTgY+OO5Q11/qNxTYgajh5Y0QslD4wKeHV0JBaTi88jFuGz44Vjhj2kod6Zj9 ZTeweHKo3qvtJIVyFKz94hS6HG+XHJxivP7LWlojWxDO6TxgT9UWeYFaqZG9Fw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1688976823; 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=mjzAB0fzsGtpLPet2sHs0gH5HogT3zoQ1G1ZId/Omvc=; b=YPYe8GiwtjZIR+272qfTugkeqbh4LCZA6RFtM6NLfaWx2/c+TLyd86psc58Ych25tSVyMf iguhKx0d7waJHsAQ== From: "tip-bot2 for Miaohe Lin" 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: Use recent_used_cpu to test p->cpus_ptr Cc: Miaohe Lin , "Peter Zijlstra (Intel)" , Phil Auld , Mel Gorman , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230620080747.359122-1-linmiaohe@huawei.com> References: <20230620080747.359122-1-linmiaohe@huawei.com> MIME-Version: 1.0 Message-ID: <168897682340.404.2001714944772345675.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1769210706534540327 X-GMAIL-MSGID: 1771021986297025816 The following commit has been merged into the sched/urgent branch of tip: Commit-ID: ae2ad293d6be143ad223f5f947cca07bcbe42595 Gitweb: https://git.kernel.org/tip/ae2ad293d6be143ad223f5f947cca07bcbe42595 Author: Miaohe Lin AuthorDate: Tue, 20 Jun 2023 16:07:47 +08:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Jul 2023 09:52:30 +02:00 sched/fair: Use recent_used_cpu to test p->cpus_ptr When checking whether a recently used CPU can be a potential idle candidate, recent_used_cpu should be used to test p->cpus_ptr as p->recent_used_cpu is not equal to recent_used_cpu and candidate decision is made based on recent_used_cpu here. Fixes: 89aafd67f28c ("sched/fair: Use prev instead of new target as recent_used_cpu") Signed-off-by: Miaohe Lin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Phil Auld Acked-by: Mel Gorman Link: https://lore.kernel.org/r/20230620080747.359122-1-linmiaohe@huawei.com --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a80a739..b3e25be 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7174,7 +7174,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) recent_used_cpu != target && cpus_share_cache(recent_used_cpu, target) && (available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) && - cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) && + cpumask_test_cpu(recent_used_cpu, p->cpus_ptr) && asym_fits_cpu(task_util, util_min, util_max, recent_used_cpu)) { return recent_used_cpu; }