From patchwork Tue Jan 30 13:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 194180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1234738dyb; Tue, 30 Jan 2024 05:58:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqOPZ8FkSTSPPyjOgSdWbD06OInSA48DTihwHtCcQPj/GHSTMsVDAvS+aCSJS5Q3RxYOC6 X-Received: by 2002:a05:6358:f485:b0:178:7542:1a58 with SMTP id ku5-20020a056358f48500b0017875421a58mr3951611rwb.7.1706623090742; Tue, 30 Jan 2024 05:58:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706623090; cv=pass; d=google.com; s=arc-20160816; b=EQNqUD6GorOjnxgCdqmMaz1/vdvHV3IA4nACYa+QveUm8G7CVryCRaYTNDNzdVcGCU eY8anHWZPBHTVCqGVqHMyznW27vlEpxx1GdmSVV1dPF0EBtEqMfuUV+/nFuHG6jQtTs1 3eaVV9VQIyfBHt2RGQUTjoCxI9D/ou7rDixTVzmBYgqUEPmLHgmWNp+yV1bq0k0Fa151 VzaaM446ltuVk3Y72CmmOGsb+i7FpJQYSCnWiAuvg4Rl8UWCdRdXBfcXdq+TGrfgJpPT jqPgpvMlOKhd1VbpxQjm9yM2PdT1lbOL4rHZqmL1MAVWO9ZuO0pGWmHJ5Fp09tfRKeNS km1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bfF1zBa7nVc7gHEDl12BBpqrow2jXHEF8ijxJ/UB0jQ=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=QgoNVuEy8kiPqeteRhf00YZvIm0HE+AXwSjZnM52hQzgS+CX/U4siL1oM8e1OXzD6Q 1LYcxEKNlxkW/lupg6OXF+hjiGG9W0DHcnYgCaDkPzrFB/8GDfPJiOvDV705Au2Ue8XG QnX5NR+ZDlPVhlC3xdFzttcjbuFNESBrGcJFMgwwK8pNcS/W8M2Hy9p8db82A+cACAvo 8EMNITP+oHsqavN/nRcFbhMZxUST4V330dxctUr3HoWckOq4AsnH1ZoQSATHxCrFF8pC /1JJgizsDkAHhEzHUt+7zUxWNGZStCKwT6U6zTtM4ZzTyHcjpZc10K4vo5JXaT2KnUIc J3Cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YNrtEUQH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44686-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44686-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h126-20020a636c84000000b005d7bf204e26si7444386pgc.899.2024.01.30.05.58.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:58:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44686-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YNrtEUQH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44686-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44686-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 736B5B296C4 for ; Tue, 30 Jan 2024 13:15:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5628D74E25; Tue, 30 Jan 2024 13:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YNrtEUQH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9319F6F073 for ; Tue, 30 Jan 2024 13:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620473; cv=none; b=Oy4j3Pew2Bwjnpup0swu8dedAJlez0JPp1L2cJchAtnuX2QzSyuP2ooK2YMwoJiCTSC9lrKwEwToUsh/sQWxd0mOTHdSiR9K3iQP+1viC0tlfGF6cHRRqspHbf1mosFKxBVQ0/M6aGm/I6gQSmWw6hjC2DE6HDGm6EgWuNx91qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620473; c=relaxed/simple; bh=g+mDwC9FPU+XmcCzxUJ4hYXHnkp5fd/Hyf0d6FKB8Rg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PSeTKEbyZrCtN+I66Hozh+RPKDxwz47m1/AU4hHvzIbhqLq1P0qSOpc0gpw9sThFAbCgiZVAs56+24yUytE81xIK++ogyFAaVMHa/R/bw+GR8we5Vpa01816pYQign2clzl87dKbZYVEtSbtsM2yUP1avZIYxoqcZ2XfkIxi35c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YNrtEUQH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CF9BC43394; Tue, 30 Jan 2024 13:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620473; bh=g+mDwC9FPU+XmcCzxUJ4hYXHnkp5fd/Hyf0d6FKB8Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNrtEUQHPV4xlePXQ6bNoPbZUy0QY/ygNg91OYFhS3FGt7U8wGld+bVHMvTz9l3LE doiIaK5zw+jr/I8PRnw4XKDB9aVDgs/U2UcYq7aY2WwTrblQyXf1bbL0NTRWDEq35n gdp2a8c0Fjd/8W7n+KYY9LLuYKQLcGRcrd/jCCzPTohOsmUxT1EJS8hyEEpfueRpzR BLDAx6QffUjuSONcVLGKjW4hbeQFiWuBhLlrkAmD72bkqAu4Gin9FPcN0bD4IPNJqg l7vpgDKDOEUfJ/Q88D+Ym1r9C/WJr06Wx2fui6ugjuhMfnqRsvG4U+BRdQQYRYyqug HFuO6TF4MSF2w== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, ricardo.neri-calderon@linux.intel.com, sshegde@linux.ibm.com Cc: Alex Shi Subject: [PATCH v2 6/6 RFT] sched/fair: change sched asym checking condition Date: Tue, 30 Jan 2024 21:17:08 +0800 Message-ID: <20240130131708.429425-6-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130131708.429425-1-alexs@kernel.org> References: <20240130131708.429425-1-alexs@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789524014105573786 X-GMAIL-MSGID: 1789524014105573786 From: Alex Shi Asym only used on SMT sd, or core sd with ITMT and core idled. !sched_smt_active isn't necessary. Signed-off-by: Alex Shi To: Ricardo Neri To: linux-kernel@vger.kernel.org To: Valentin Schneider To: Daniel Bristot de Oliveira To: Ben Segall To: Steven Rostedt To: Dietmar Eggemann To: Vincent Guittot To: Juri Lelli To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6680cb39c787..0b7530b93429 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9744,8 +9744,8 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) if (!(sd->flags & SD_ASYM_PACKING)) return false; - return (!sched_smt_active()) || - (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); + return (sd->flags & SD_SHARE_CPUCAPACITY) || + (is_core_idle(cpu) && test_bit(cpu_core_flags(), (void *)&sd->flags)); } static inline bool sched_asym(struct sched_domain *sd, int dst_cpu, int src_cpu)