Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1020759rdb; Tue, 30 Jan 2024 05:56:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjdH4SRZgi0tDZs5UDtJfaflO8IHk62ZtkihbUpmfOg6evPiy0Vp8ukl/0OTiTaYhCLItW X-Received: by 2002:a05:6a00:148e:b0:6d9:ba0b:dd72 with SMTP id v14-20020a056a00148e00b006d9ba0bdd72mr1490077pfu.17.1706622982972; Tue, 30 Jan 2024 05:56:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706622982; cv=pass; d=google.com; s=arc-20160816; b=zm4X+3fPb27MIQYmhwetNzbyHV0QFNu6AxwKgwjHiSjgYEO8Rmj1DAYFHOAH0Fn04u fdB/ytrwnda6Te2djPEYYj41s8HCP/yMEclaqwAl0JBFTz+V4l1G20N8HFKvPiFp+xBi UOpeLjgNvexx2gL/g0Qk954OnCVDENZi79bG3UW0VqAPUVfon3Lctrfa7SmW2zpHGdCx XAdPeCkp1ZZ2KqZkSpQnOyfMdxK9gVWd674bC6uUaPL4zEmHNWu2mAvAmdkQhFeyHqik jgRN+YKsChfOydGIvptZz7UUKK6yR+JXswAj+SIezQp/2Vu77SYbDXRfakkgUOj8naAZ fzhw== 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=oRBLQJbbCwobDB+pFl37jFjA+Qd4tVNBxzBT7KWDBV8=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=uTpDn/JoA7biwbM87qqc5dmq4fvbm/jwCOoQAyDiI9TIkku85lp1GhtIUxwPgB/HXo AtN/1ZbFWxxLq/ZTRkovrWY0OI9IgJpA1L3Ce5BP75sN2VPdnuowaPg5JCpRdPpW812G KZgayF6NfX7Tc/OREzPoaqXqPyQLn/FN2B0i4xQDwbMY7m4GKJGUgG6O6mDns+TCNIug Sum4SRVcHeksUizstjtNXS9xLA1px7GwGudEEebB4akg8r7rlrxkymq+CV4dhbvRnkoU Hg19TlwHOZn6HP0abkH720Gveb5LOhkN8Quu94FsrVn69IdGmIyPmSL84MMwi40f3kAa L7KA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Hd3ps/Y4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u14-20020aa7848e000000b006ddc2570b53si7355495pfn.396.2024.01.30.05.56.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:56:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Hd3ps/Y4"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44685-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44685-linux.lists.archive=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 E615BB26BCA for ; Tue, 30 Jan 2024 13:15:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC3746BB4A; Tue, 30 Jan 2024 13:14:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Hd3ps/Y4" 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 043936BB4E for ; Tue, 30 Jan 2024 13:14:29 +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=1706620470; cv=none; b=PPNlMcd5Su4bp3C+wepRGJ8R2NTbA3OFhskt0lIyNAvjWloJ/KxCYxEOtDNeAdA5yRgF25g0g9zcyvs4aXHd3yVCcxVxzWHjWvZTdBgE6jfCwG6WgJvEKWP7zi+N6m0GfUg7Dpcvh2CoDsxF5DNDJ9i5kDky/rmRZh3pfAWgWdc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620470; c=relaxed/simple; bh=c/1WLOAzJwWvvX/sgjls1EE1+Z+vkWbOlUsZdDywdRk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l4AYmrzN0iB9ZRTbbx7TAuVBwAszXGlc+GQk2SvI/GawBI5UPqqgSuELlht2yAFzv3daalJ4gP8Hj8pReuCUlGSL2E5aR6ifTcmFMS42jq9PoaymI4CxT7QiRiB+QEBy6uwz8Ea0Cn9e6IfZAhvfKKpbww3aPC9swicwV0qYcKI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hd3ps/Y4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAC96C433C7; Tue, 30 Jan 2024 13:14:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620469; bh=c/1WLOAzJwWvvX/sgjls1EE1+Z+vkWbOlUsZdDywdRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hd3ps/Y4HblMhC0xw3r7X70E3ks/5ppE6tv6mPpnNsmQdi6REpusZYFZPRRa1SK/X INqbcdzMpKf2995ytotNzgE4BlgYua8EyVDtoQpUrzcWsJPqW0ChoyhzrP0FQnAW9E WLk2kenCEZtpYj36bH1JgoZkxCEHSVfXRhHSHGktvuuSrP5FjEySvCUGNjvKQwi3lQ NUzC6pZgq0zxSaXbBXQk1+enHWi5odj3VXDkfEMKTFvpbui92TbM+PHI+eDJu54QLr x0DrFmYXKTaRRdKYGXNtxOQHFPO7emjI4370wjUbo5KBmP1Nk5D/urWWiDzCypGdYG FefAncI4V72wA== 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 5/6] sched/fair: pack SD_ASYM_PACKING into sched_use_asym_prio Date: Tue, 30 Jan 2024 21:17:07 +0800 Message-ID: <20240130131708.429425-5-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 Content-Transfer-Encoding: 8bit From: Alex Shi Then the flags check passed into sched_asym and sched_group_asym. It's a code cleanup, no func changes. Signed-off-by: Alex Shi To: Ricardo Neri To: Ben Segall To: Steven Rostedt To: Dietmar Eggemann To: Valentin Schneider To: Daniel Bristot de Oliveira To: Vincent Guittot To: Juri Lelli To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/fair.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 835dbe77b260..6680cb39c787 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9741,6 +9741,9 @@ group_type group_classify(unsigned int imbalance_pct, */ 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); } @@ -9935,11 +9938,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, sgs->group_weight = group->group_weight; /* Check if dst CPU is idle and preferred to this group */ - if (!local_group && env->sd->flags & SD_ASYM_PACKING && - env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && - sched_group_asym(env, sgs, group)) { + if (!local_group && env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running && + sched_group_asym(env, sgs, group)) sgs->group_asym_packing = 1; - } /* Check for loaded SMT group to be balanced to dst CPU */ if (!local_group && smt_balance(env, sgs, group)) @@ -11035,9 +11036,7 @@ static struct rq *find_busiest_queue(struct lb_env *env, * If balancing between cores, let lower priority CPUs help * SMT cores with more than one busy sibling. */ - if ((env->sd->flags & SD_ASYM_PACKING) && - sched_asym(env->sd, i, env->dst_cpu) && - nr_running == 1) + if (sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1) continue; switch (env->migration_type) { @@ -11133,7 +11132,7 @@ asym_active_balance(struct lb_env *env) * the lower priority @env::dst_cpu help it. Do not follow * CPU priority. */ - return env->idle != CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_PACKING) && + return env->idle != CPU_NOT_IDLE && sched_use_asym_prio(env->sd, env->dst_cpu) && (sched_asym_prefer(env->dst_cpu, env->src_cpu) || !sched_use_asym_prio(env->sd, env->src_cpu)); -- 2.43.0