Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp67706rdh; Tue, 6 Feb 2024 19:56:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVilw2acrMQejZ/thMcX6bvyx+qrU7ByRpd/jvum6ilL2sgUpP6w0EclxDw1nNLnu7BUyEuoDOZ0FccDgK9xYi533bK9W/nA645kwxwmw== X-Google-Smtp-Source: AGHT+IFnztox5b9tbjZfa8cBSCaomKaVgPWMY6yoPEEY508su02GnWIsp3y65d0TfAPTdhOvyS4T X-Received: by 2002:a17:902:ea0c:b0:1d9:63a3:e962 with SMTP id s12-20020a170902ea0c00b001d963a3e962mr4483536plg.6.1707278203699; Tue, 06 Feb 2024 19:56:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707278203; cv=pass; d=google.com; s=arc-20160816; b=ydQ53omwtLShYrvnZ6DcxLtOSvO9LUcHgKPz5nLL9iLxXS7b4TxKls2j6r5h0mDJig Mwr62szECCxwLmyumM+GtVfD95vXOC075KdYPIjkLs0QEI+LfJD6Xvd9mpEqlKaQGrr5 8TjYGT9HswAYRrd/oI2RQ6rVgrj1ku+CQi09KATF5TJZX7LcfEwJWi5doEeSgv6s4k5a KVybrrkEvFZ6NuzjbrHu4fYibjGdrdQXejHatbnq9SkH900DenQsoIl0lqDgAeomVr+e /NKybCjRVfPn6Dw8JEib+TQnWg9aEeUyp2hz2wwvOMT4HtvIt2JSJSc5CakpqOsEUby8 AP/A== 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=ik2cotX23r5Hd4AICdyaM/XDRCBerV7dO7M5HlB9A94=; fh=BhBGJftkadJ9pTbrRISlq05JibZ80QwvxRtVRAhx2C8=; b=EWfxzSub5mV0iMFdBSkAST4/whdjOjxFYZFed77u7RM971xxq2Onc+HAYL6/RCRWzh nlq2FYKjMlPLvbzlgtAgEJewuqlIgsxUEQrXz4raZn8YFMvrYu9bwko1QvBub1HctxEi YHj2Wwi6VqcYKT3IVqvR3vV2wAV2y2Xm+KJtINpo76d/VjFa7wpb9XsdqeRtEcLyvUun z8hOYwu1Ic8VbUgEcavAhWKHvTMmgztUXk91quSkJ/utdq8YVrmh6Myvw6RLmmps/ji7 Q3lmhlmXKgh3dAukQEXAMHLTEAbP0FYrVBVDdneKzsw3AEUYEpsmqM47zj6B94hrx3CU QHIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JVqunjyh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWTp12zHnAr0oCjcXJ/ar6OkHd5/okK7QpHY/12BxzDoh7U6PqOlmt6rUCfLFrKUNbM3ajibnrwXxyRzvTGhv5FoEO4hijBaABxCiEQhg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jc22-20020a17090325d600b001d93b748a55si588315plb.25.2024.02.06.19.56.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 19:56:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55908-linux.lists.archive=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=JVqunjyh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55908-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 227C7B25D09 for ; Wed, 7 Feb 2024 03:45:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51AF11CF90; Wed, 7 Feb 2024 03:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JVqunjyh" 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 62DF11CF80 for ; Wed, 7 Feb 2024 03:44:21 +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=1707277461; cv=none; b=p8/kDztpGY8GF/53rdRr35G8KaapV4uAJQnUJCrgP8uKHAB4caApKQ00F6G8rwtnZaqyyUIwYfn7SZIrdEqLJ+imH99GeCn9x4hERrCF1zpEFP64y3k0836HkBaUx1ugEKGVuNPZoYEXa2MS+C8JMa+QXEAQ1+ux0AmvbPHVgiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707277461; c=relaxed/simple; bh=JRihQeRnvMv6IBslLO3YQYd+JbOoJjzD4VVOTcl40hQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Noh0DryfFOr5uoJz4+0xvrx29k90XL6ew0ohQoEfYaCDIL1Cy85PdC2wQLPeN7l/ghRRsnQqLxVG/Ob2TmAQDSmtLn2laFb1j2bq6WXOxYwkZdbWzkp7u0FiXmK3YjMi9vStyyGNVKuurmykNOmPo1rwkzxD9hmIFgPkEQxBztM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JVqunjyh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE4A7C433C7; Wed, 7 Feb 2024 03:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707277460; bh=JRihQeRnvMv6IBslLO3YQYd+JbOoJjzD4VVOTcl40hQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVqunjyhj6v9iIXA7+241LS3sT9Zrqu2nctH3nylTQFehdPLbLm1Bh9DUwe2RVHEv 3SiRF9snGljzV3h3qluoCadqVVBBJ6y9bpUWjUG8/VRuAqnng08hvVWuRPtF/vJsdC Nd/yS6E5P3GlrE1+sqsuIRu97G0px/UEftKWACDtSVYmjzoYevAeWtCeG9KS5NxgO/ cgHFPzBjQNUqa5zhVaSYSV96MqtsKFYN6J1eMy00l/XzypTsRiRygSbxE5TfFhux6y zZYLiE4mAzS2C4jD5rkLx+nm9b0rbjYjctvzYmZ5vI0oR/SMWbLEh3oMPVcNc9LY5l Mplk7d9HIqjYw== 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, yangyicong@hisilicon.com Cc: Alex Shi Subject: [PATCH v4 4/4] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio() Date: Wed, 7 Feb 2024 11:47:04 +0800 Message-ID: <20240207034704.935774-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207034704.935774-1-alexs@kernel.org> References: <20240207034704.935774-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 sched_use_asym_prio() checks whether CPU priorities should be used. It makes sense to check for the SD_ASYM_PACKING() inside the function. Since both sched_asym() and sched_group_asym() use sched_use_asym_prio(), remove the now superfluous checks for the flag in various places. Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org 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 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 942b6358f683..10ae28e1c088 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9740,6 +9740,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; + if (!sched_smt_active()) return true; @@ -9941,11 +9944,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)) @@ -11041,9 +11042,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) { @@ -11139,8 +11138,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) && - sched_use_asym_prio(env->sd, env->dst_cpu) && + 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