From patchwork Tue Jan 30 13:17:03 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: 194173 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1212727dyb; Tue, 30 Jan 2024 05:18:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaB8hXN0xqusDjEG2J5itWD0qZOGQqa1FCvpetmjcBYJPEIf9+SLUn2UzB+BGoKBwrT/90 X-Received: by 2002:a17:902:e805:b0:1d8:f98b:616b with SMTP id u5-20020a170902e80500b001d8f98b616bmr3351194plg.44.1706620734926; Tue, 30 Jan 2024 05:18:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620734; cv=pass; d=google.com; s=arc-20160816; b=eRvvkqNkieyJ/tGK9ZgKMaje3PqrVZ8WePcmo1UL1VhAbeIFOAFojHx7JKMlbwfH1s 5f2C0tKskqrnIYgWeiPGwy+xT0pWJfX6WdLdX0PBjH855O+C1wKs3NKh/RNlpML1cqju /WAYjtO/fqM2I5u2Lfub5EJddytbAINoh9JqGGz6O8BuiT5TW5IQhIyyIktVuSeSN0or QA5OIxd/zQF/WSxAIKVvBOEzgYQlhSe0TLUbdXyqhylIQaaXIW8OlWfkCCB4H9ziVbP3 a2yc4yedwVwKKCHOQhu4ZQgRlLz0yzfGFQrzeax62g2lObQEKWLe1SPT2qEhDtbCx4OT FTlw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=J9S9kBFVDwMUdPrctuaoVQn5feE1iZbC8Kk+U2zDv6U=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=0q7huxroCw1hyrlFU13RFMSbsgw5AUx1Y80UvBNd0NWBK/L33jsJBjrUanDr6rRtgh 7PxtLzSQD0aNm57/Kyz/TyWERTnU4LsZ/mtAgwg0l8E8dr1/ytjIy+oGD9t9xB07Unzl 9XQ13JqmJQ0s7DQVTyRulwp/y8fLeR6kX+cCfFA9+0kVNDewz/gKSRdhYc6EgY4qZDGm 46IP6sjAYFqyEz6XS4NUL0sCPj9O0pngQPxgLHr/M2i5uXV01zVg25+qF4r7cPiQ+us/ Q4pF3G4fal2g9i4ekrC0UF3P27EdOVsZTAMd7FYle1eXD9dXXjQ/3sdb/9eCf8U/xNaA ECmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kO/mGNHP"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44681-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44681-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m6-20020a170902db8600b001d8edfec66dsi2705568pld.443.2024.01.30.05.18.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:18:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44681-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kO/mGNHP"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44681-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44681-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C945628E4A4 for ; Tue, 30 Jan 2024 13:14:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1E516BB54; Tue, 30 Jan 2024 13:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kO/mGNHP" 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 3DFFF6A337 for ; Tue, 30 Jan 2024 13:14:15 +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=1706620456; cv=none; b=hwqyyOVUDRhjL9AN6IREGHn1jJliwnLlKdJUUzJC0w23jhryliSJU8d95KlrCeIVzHye+lQR/fSM2HJOMed3IkQd/EcOPYGs0emIDhF9gj/0UIL88VgXYCXbmGyN7v5JpftyFcdzJ7J1FoGlVCsbowTvcgwVMa0LOOA0awty8kA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620456; c=relaxed/simple; bh=igel0xrDbniIkaaDmTpoNc96gkHdCdCHSRZ68ZZFEe0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rIEqFyRpzVg2I0A4eJmEJ87a/Tb30bvbke6b6CgVd8MaUKLNfQt+ZVpwv9sGXxSXxEGyOF/lwqmh6jwhe18XyKGVZZbhzEfAypmIGaQjxo3n7h5ibkZIeFwgKlftZbTmTfq1xkXPzuremmmxwuIBioSoFBNks1w1EXBuRukv9EQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kO/mGNHP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3BC6C433C7; Tue, 30 Jan 2024 13:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620455; bh=igel0xrDbniIkaaDmTpoNc96gkHdCdCHSRZ68ZZFEe0=; h=From:To:Cc:Subject:Date:From; b=kO/mGNHPhKqQWzL8j0hqH3l5sXFFbDogLO41f5djOqMxCipaBrG0h4rBODXPevz9/ qW6XeRZybwxQw70VKy53GVtMppl2Pz2RDUtwDV8JnqpEg1ji0rIRMBaRhuKNIpCZco y4fSSK37mcprJR7eTlU0Gm2R9JldtM5zfi+9gXXLlpPZIZDPjbze+0qVt6AW2ONvjZ XvjbBnwiW0DqmN7HnNxOjT7jRA5djDlrIenDZQtWn0X7eqWHKe3gjSInyz8bQMxdqu dniLjoe6QWjEQPgt7NB4eeHrC78gL5NK8JXfrc2DOS/2y7QLvwtSmLpyzH1j0x6eKG dZmQUBsVgapYA== 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 1/6] sched/fair: add SD_CLUSTER in comments Date: Tue, 30 Jan 2024 21:17:03 +0800 Message-ID: <20240130131708.429425-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 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: 1789521543497223553 X-GMAIL-MSGID: 1789521543497223553 From: Alex Shi The SD_CLUSTER omitted in following TOPOLOGY_SD_FLAGS explaination, add it to fill the absent. Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org To: Daniel Bristot de Oliveira To: Ben Segall To: Steven Rostedt To: Dietmar Eggemann To: Ricardo Neri To: Valentin Schneider To: Vincent Guittot To: Juri Lelli To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 10d1391e7416..c342c52b1f34 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1554,6 +1554,7 @@ static struct cpumask ***sched_domains_numa_masks; * function: * * SD_SHARE_CPUCAPACITY - describes SMT topologies + * SD_CLUSTER - describes Cluster topologies * SD_SHARE_PKG_RESOURCES - describes shared caches * SD_NUMA - describes NUMA topologies * From patchwork Tue Jan 30 13:17:04 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: 194174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1212829dyb; Tue, 30 Jan 2024 05:19:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDCabqE6+/ujh6Sf7oeuT4Eqg7ffcWQj5/XwHeteZEgoj5gYu670IqWckDFpdK/17K/aXR X-Received: by 2002:a17:902:6b03:b0:1d8:cbcf:2150 with SMTP id o3-20020a1709026b0300b001d8cbcf2150mr4286797plk.81.1706620746125; Tue, 30 Jan 2024 05:19:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620746; cv=pass; d=google.com; s=arc-20160816; b=IxDp0hIfLOOR0MNx4GAnL2rX2jdmxiOHO7kfc2RXc/n+isLx5YEJ9bmPPPrEoE5c3k 6WpxtfUYWa0Tk8A3UBS9cXHkQDyubJZ/HahpxNMaeoeoouSNi+qjTtKkrGaxJXapq/Im MrUq3oxLUMYf+gZLgD5508WDZcasp6e4vFC/E3kvFPq6cbdPj6BBClKl/wDRwIfIuE29 J5iV3uXrO8LWnjWHoEDdmriuLX+hkb5M0V72Py4aZpaTRq7QIVaFtBPyUI74Hxvfu5lJ Gf2FvP22V3PQPC+LNjAitzU5IfhMvSsI/BOG+kB3N8nw6KpRDOpIofSC5/ueaBpHBjX6 uaXQ== 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=rovnZYMgdqdgO5q7kI7J3tmOYFmuTAdfJJw/mzec5tk=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=JcmZK7CGeNSedQP8f9c3ede9UMtitZOBD2SDWUfrbcVCl62MkLav1TgN5pMfUPIhWa 2P+NRIzhU/ROO/f9PNIrecye3hNJ46jW8osqd9Ij7szU1L/EPYeBcji1Tjshr7roHdgI 45gK6rMRTpUbzhH15qi9fFw7fhZxx9Fa6iayZYdAKlw8aPANQIBLP16UHN70BMwB3iGp RpwJNNr57ckS3jGyJz0xAzpTMfhaAt5TKU/jg1TThl1H/wHdwRitOGmL6iW61GW5c5x0 MO3YEWB6Zl/e/pYsoBat571NhB4umbgU5TppwGnLkbomKnD6VWqGG7lQ5oETsMfUJM4b s9Hg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+rSmKXL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44682-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s133-20020a632c8b000000b005d39e412039si7309558pgs.8.2024.01.30.05.19.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:19:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+rSmKXL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44682-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44682-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 16D0B2905E4 for ; Tue, 30 Jan 2024 13:14:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 572586D1C3; Tue, 30 Jan 2024 13:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m+rSmKXL" 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 B65406BB5E for ; Tue, 30 Jan 2024 13:14:19 +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=1706620459; cv=none; b=fpKcYFwcR5LWsmDGjEBKaNl7GCDkUP+LLyiZAxUCe4cqa/9fDlBjsxoj0VqWrVi5t62Im+bzAbneFFi7mDCxJzFdSTcv49fGWBUnxZp6KgV163NijuXBwGdgbEzJWei7Aatj6Rof/PreBOHMRTcQ0p7iuvUs8ApFR9JBfHrkpuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620459; c=relaxed/simple; bh=ju/4UGtzVW6SMMVqyOTJ6eGP1qKCB+pqoyI2kbcnF5w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ONHjn4+l6AEpkgkCJI5Ks9RPx9d4gjoCxc6tp1mJDuZ2D3a8uzrqloL8EkSHhmncEO6TupISlY1fwuGJBz1AyOcRQ98TadZKRjL888TaE4tj+ZX/BhmOWMwfj5tT5IeunYe5qnfYB/jJQWg4sJ2gzVhfgd3DAWTvFVdn1Hzykd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m+rSmKXL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 492A9C43390; Tue, 30 Jan 2024 13:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620459; bh=ju/4UGtzVW6SMMVqyOTJ6eGP1qKCB+pqoyI2kbcnF5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m+rSmKXLmTHihSSFyJ4yx5grOtzvxCwZlnzkXT6/iEIPoynRQj+uDJ8exj9aZSIXo gd8YhhYRov+kTJhXjm1pDqTZtOHfgVUudtzlqDorAWeGvWHgX8O7qGkrxrwlF4+JSg q6ahcfZ9EtXpX55r/h3oYBzuEVWDhNYoyaZ0C9XeIFEfq+QeXIKM0jbobVtN8fBrnX cjlpxu0254qHcJ3DWA/uyaB1g0vxpOtHOqZnHEdHTFgI+y8Gq1ADKXiNhQImoXY1nF Cx73dgHIv2wIt18YvX5h3+OUSk9c3KIk8SFZ5XTdtc6K0RlOWdAIQ4ZzRjQByfU/KH 20sKkZBjHz0eg== 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 2/6] sched/fair: remove unused parameters Date: Tue, 30 Jan 2024 21:17:04 +0800 Message-ID: <20240130131708.429425-2-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: 1789521555526333488 X-GMAIL-MSGID: 1789521555526333488 From: Alex Shi sds isn't used in function sched_asym(), so remove it to cleanup code. Signed-off-by: Alex Shi Reviewed-by: Ricardo Neri To: Valentin Schneider To: Vincent Guittot To: Juri Lelli To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/fair.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 46ba8329b10a..8d70417f5125 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9750,7 +9750,6 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) /** * sched_asym - Check if the destination CPU can do asym_packing load balance * @env: The load balancing environment - * @sds: Load-balancing data with statistics of the local group * @sgs: Load-balancing statistics of the candidate busiest group * @group: The candidate busiest group * @@ -9769,8 +9768,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) * otherwise. */ static inline bool -sched_asym(struct lb_env *env, struct sd_lb_stats *sds, struct sg_lb_stats *sgs, - struct sched_group *group) +sched_asym(struct lb_env *env, struct sg_lb_stats *sgs, struct sched_group *group) { /* Ensure that the whole local core is idle, if applicable. */ if (!sched_use_asym_prio(env->sd, env->dst_cpu)) @@ -9941,7 +9939,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, /* 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_asym(env, sds, sgs, group)) { + sched_asym(env, sgs, group)) { sgs->group_asym_packing = 1; } From patchwork Tue Jan 30 13:17:05 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: 194170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1210173dyb; Tue, 30 Jan 2024 05:14:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIkG8iVpTCjMF587j6ZEQ55pPqhSDgW29prz8QktCSnTHzZaxLboV1ZwhPDQZzj9yuz/PT X-Received: by 2002:a05:620a:51d9:b0:783:d0f8:c5ba with SMTP id cx25-20020a05620a51d900b00783d0f8c5bamr7722804qkb.8.1706620494760; Tue, 30 Jan 2024 05:14:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620494; cv=pass; d=google.com; s=arc-20160816; b=AfoyCGVeAERd3UwZX1atoxnFBFRUyiodIYJiSGpAGIpaFGO6JLGIvjYwIdJQ4Nfu2b xSjBMqkzUnqyx0VczsLoBfCaVU9j2GNl8G0Tg/6XF0RR2LgbvabRM7WU6veb32SnbFfa +GVD3c/tf+FjoOvENdqLzuVVI4yriw63wjtUPYg0kgLShxWv5rb3Hp8y1wruzZfCdobG kzc5r9wQiKR3Y0UYHhXSd5ekDeCEuVQoH/4iUQgJQoQVasaU38TPqrFrozhrNZtfLqzy 0S8YHWmUftqNrnbJtp7wNcKHXpKR9McdTzO85c2Jh6jKDIqdm0mCP+sL7svYk65N25I8 WIHQ== 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=Nz5IWNaCLtxle2arfvAWM+KcsFMGi04e8HWFD5kjPeM=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=C2+GaKBfDD2vVMdcIdf+uP0CwjFI5hzhSxQQ6P1cWq1xMV1Y+AvZ+uUsdbzNhHHwHn 40gqNtBWBFwxLCrZ0YNiKuDK/UrM7umh74Vp58pESNoVYTsLOj35iMciuWqHY7shH/bc 1sKvt71o6XdNJb35KJgJxFT5Y6Kz2bwO1yf2UF+dCTahGj49a/3BEf27gzJr6TnOcCr6 6HA+3XSDWM/rSOFqTA+fhhN0YE2J7d0zLkX1Xjv5o5Kqn78ZNyGUGfC1sB+/k5pttgot 7pOP+9D1ki0710odk9qP+rV7Qx3obEFuiyA6rrvc3f17qWSpfTSKvP1k1O87ek97LQCN zcag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYZIrhXs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id br31-20020a05620a461f00b00783e73689e4si7550118qkb.315.2024.01.30.05.14.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:14:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYZIrhXs; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44683-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44683-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D28C1C2583B for ; Tue, 30 Jan 2024 13:14:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5A386DCEA; Tue, 30 Jan 2024 13:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oYZIrhXs" 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 3359E6BB5E for ; Tue, 30 Jan 2024 13:14:22 +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=1706620463; cv=none; b=sKzmKby78639TpT3lkouhvX7T5Ev2QObRDPn7CEl290gj0DWyvzEXqPDPopjQQJQqOHpJrKVbVMLS/JdkT4TERr6z12/7xwc38zp58Eqh5+xXV2ysF6wTfvkKFsv/d9qdpBefPfeg9cQ87bnFSKEqJosH0N8bhX152LNGifFfNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620463; c=relaxed/simple; bh=yCvjq75MG5lal2aoR5CJIjlQvsuAuYZd+/xwaBRiyWk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QlTzQ8zQ0uL7vZCRqBT3T1cAZJhPN4CsMD149I46zVHUW3xrbbLurm5fOI8duUlp4EyNCRHDW3Y+knp9fHNI10wtZGb/ETuuIc2ScYtNnaunjumnjxySETumf3a8VnJ8/JTkZZXZo1fobMmuyc0CUJzloVoXpooxml3SHrJznjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oYZIrhXs; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD65DC433F1; Tue, 30 Jan 2024 13:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620462; bh=yCvjq75MG5lal2aoR5CJIjlQvsuAuYZd+/xwaBRiyWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oYZIrhXsCkivSFCFCcqxyVyfyBW5b32qzmemiHnXjllfQMguGWygoJfX/s3xJgKIQ Npk7xj+iJ3VRzPWbadCThqwUiEC4xHfb+VOHYVKE3Zfc47MmebtPd/xKLhzfIn5u2A +f3z9UIcYfOK/3kw/XFQ5W3LLxwtax9MhDdFCd6YaUNwNuWWeoOW8YQezXKyPPzDVA A9K255xR7tf19UwM89aIJQoIZmwNXTNVLNycEZMgdxOQJDObJn0yyeYqHCkA30dSub j49KSh4mkRQFetWdnR2Mr9dhYKM50Lh8lWT8ap0YJGSBBaK0rbhuPG2AtLr3M907tZ WpbT9c8ajIANA== 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 3/6] sched/fair: cleanup sched_use_asym_prio Date: Tue, 30 Jan 2024 21:17:05 +0800 Message-ID: <20240130131708.429425-3-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: 1789521291536937321 X-GMAIL-MSGID: 1789521291536937321 From: Alex Shi And simplify the one line code. No function change. Signed-off-by: Alex Shi To: Ricardo Neri To: Valentin Schneider To: Vincent Guittot To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/fair.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8d70417f5125..ebd659af2d78 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9741,10 +9741,8 @@ group_type group_classify(unsigned int imbalance_pct, */ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) { - if (!sched_smt_active()) - return true; - - return sd->flags & SD_SHARE_CPUCAPACITY || is_core_idle(cpu); + return (!sched_smt_active()) || + (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); } /** From patchwork Tue Jan 30 13:17:06 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: 194172 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1211413dyb; Tue, 30 Jan 2024 05:16:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IF44J7RQTSw9X02wmkoHlBpJuSFK9EV7K7VbtS4deHiZCw2kd1KU1bLMJjytM8ZHqUmFei6 X-Received: by 2002:ac8:7dc1:0:b0:42b:def7:771 with SMTP id c1-20020ac87dc1000000b0042bdef70771mr575765qte.80.1706620606663; Tue, 30 Jan 2024 05:16:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620606; cv=pass; d=google.com; s=arc-20160816; b=vK76aojbtFX51+vntYii3u/+GFuFYSEoAky9HVceWuM2zvDEmBhhO8JTfjQBjz4thf tPR318EfqLxMYmf1dA5qb0Sc2YkHienxVscBEdl4S/vXXZMrAL7Ln1gtcuOCvaFflO0K 1ZP59B4JNgI/O59eoh9xWogs7GMW8mdRkP4X9UuB+iVzE5vUK6lHVjGflw8UpOeKl7hK wS5zM5f11W9Plf3F0m0ANYAcO/9Ar1jD5uvJU7J2poMo7x4zDUcbd1VVPR6cUrmsWGFF aIHDjBhXwLeAig8GogIbvCnoTn6vbTI+oGBk6Rli1feSnzKbX+o+WbobAOY7+QMY2MEb IGIQ== 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=JqV4+TzQe8MTC0S2zUkHsxoC2ri3PuOVwTzg6Pgd4do=; fh=CH0OO+rsEMoKRW5HY96+2DQ466rE9ttKX9bm1c+/3Ro=; b=EBLPfHy79K1hX9UFJYK0MIMvssPHhw38lQbh1CTA5CGnQPlwjy80fVp8ZJ56tU/Jpk t9IASp19fANSVfZ92erwlv9W+qPZEGpH+Wz1x+Xx/ZEFODSDDKWTH2JJExexMlBXXPzH spvA10b3wFysDnpKQZ3KRzLcOFAi3bblqqAGwIl4ADe2ykWoI/ZPkLyPYYCX+jzLk2Wx +aD0tbgJvmmjeClOo1y4W5tlrtJEyxaUPweK9ZZohmBvPIP45ie/DUFSPrbJmXXuuMox rosvm8O0nTxxBd4AplY4/Xmt2/6Acv46613ZUJVi4WXGP/dKsFI/j+bvvXIpTwiEJ6Bh Ee+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGMAktKI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44684-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44684-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b3-20020a05622a020300b0042a1c8ffe11si6982751qtx.35.2024.01.30.05.16.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:16:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44684-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGMAktKI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44684-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44684-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 29DBF1C25969 for ; Tue, 30 Jan 2024 13:15:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 554A36DD17; Tue, 30 Jan 2024 13:14:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JGMAktKI" 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 AC8E26DCFC for ; Tue, 30 Jan 2024 13:14:26 +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=1706620466; cv=none; b=Fh+tjIvbUpit1/hcoFzl6qEQLDTQ0OJJENSy4DLVIGj8TChG3Q0r+FxcXpzp+qm+4bZpLmWH4FQv3rajGZqlKNn5POaWsh/CfJkIm9Ph2mGt9O7hsgYG1u7E1hSMbCGZ65r8WnbFUjKoLQ4FrZyPMwiSUfLt/P9QaPBGAP7f5tQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706620466; c=relaxed/simple; bh=FRfl9LrFeYMC1cDiZLWNe9rb4nE8aM3Q/PfT7DsOvNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tJR1qJ7Zeas6Of2nSgnt919XlxY3dHiKFpasxX+mi7d4MB1eiCtFcTbksSp6WVgzmogvIQB2se3JlIqgY2lJW4fPRJRv0T+OpX6lR7EaFF6/Eb+fjAtQVEHul3HKPGZb1pE93wAtX2w0fVuFiFrf3u+FON2cY5Z+DzCJ2ent3UE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JGMAktKI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D9E3C43390; Tue, 30 Jan 2024 13:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706620466; bh=FRfl9LrFeYMC1cDiZLWNe9rb4nE8aM3Q/PfT7DsOvNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGMAktKIPWx+UA6lRmEHNpsiezEGpGSZhakC+xSZTNJezazZntNRd/UXfwH3wyJwT AJlyqQ237C2li/uyMCjkS9BHBWtrlMe70vUAmZR3nDzF6aam7rAG1dNwlL/4o+WBCe 6tq+HseJYkNtRsOmb2cbNVcD8GzLTQ3BjaPhZUn7JcYfh9XtFkM0v7Y1rtHwKCCb5N cmE2vXxa04zgMiet1Kcg2EjjOr5AFWWSH/fzypKROew8Sy8AXAwFPslyHc7EU1YXSt ljcLuQdgCw6Npaja2spDj3vElTzJwFkr3PYRpdlxF+csgON2Ml/pMJfqFX3SAgudTj +IxCh0y/DbI/Q== 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 4/6] sched/fair: packing func sched_use_asym_prio/sched_asym_prefer Date: Tue, 30 Jan 2024 21:17:06 +0800 Message-ID: <20240130131708.429425-4-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: 1789521409286118989 X-GMAIL-MSGID: 1789521409286118989 From: Alex Shi Packing the func sched_use_asym_prio/sched_asym_prefer into one, Using new func to simply code. No function change. Thanks Ricardo Neri for func rename and comments suggestion! Signed-off-by: Alex Shi To: Ricardo Neri To: Valentin Schneider To: Vincent Guittot To: Peter Zijlstra To: Ingo Molnar --- kernel/sched/fair.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index ebd659af2d78..835dbe77b260 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9745,8 +9745,15 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu); } +static inline bool sched_asym(struct sched_domain *sd, int dst_cpu, int src_cpu) +{ + /* Check if asym balance applicable, then check priorities.*/ + return sched_use_asym_prio(sd, dst_cpu) && + sched_asym_prefer(dst_cpu, src_cpu); +} + /** - * sched_asym - Check if the destination CPU can do asym_packing load balance + * sched_group_asym - Check if the destination CPU can do asym_packing balance * @env: The load balancing environment * @sgs: Load-balancing statistics of the candidate busiest group * @group: The candidate busiest group @@ -9766,22 +9773,15 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) * otherwise. */ static inline bool -sched_asym(struct lb_env *env, struct sg_lb_stats *sgs, struct sched_group *group) +sched_group_asym(struct lb_env *env, struct sg_lb_stats *sgs, struct sched_group *group) { - /* Ensure that the whole local core is idle, if applicable. */ - if (!sched_use_asym_prio(env->sd, env->dst_cpu)) - return false; - /* - * CPU priorities does not make sense for SMT cores with more than one + * CPU priorities do not make sense for SMT cores with more than one * busy sibling. */ - if (group->flags & SD_SHARE_CPUCAPACITY) { - if (sgs->group_weight - sgs->idle_cpus != 1) - return false; - } - - return sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu); + return !(group->flags & SD_SHARE_CPUCAPACITY && + sgs->group_weight - sgs->idle_cpus != 1) && + sched_asym(env->sd, env->dst_cpu, group->asym_prefer_cpu); } /* One group has more than one SMT CPU while the other group does not */ @@ -9937,7 +9937,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, /* 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_asym(env, sgs, group)) { + sched_group_asym(env, sgs, group)) { sgs->group_asym_packing = 1; } @@ -11036,8 +11036,7 @@ static struct rq *find_busiest_queue(struct lb_env *env, * SMT cores with more than one busy sibling. */ if ((env->sd->flags & SD_ASYM_PACKING) && - sched_use_asym_prio(env->sd, i) && - sched_asym_prefer(i, env->dst_cpu) && + sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1) continue; @@ -11907,8 +11906,7 @@ static void nohz_balancer_kick(struct rq *rq) * preferred CPU must be idle. */ for_each_cpu_and(i, sched_domain_span(sd), nohz.idle_cpus_mask) { - if (sched_use_asym_prio(sd, i) && - sched_asym_prefer(i, cpu)) { + if (sched_asym(sd, i, cpu)) { flags = NOHZ_STATS_KICK | NOHZ_BALANCE_KICK; goto unlock; } From patchwork Tue Jan 30 13:17:07 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: 194171 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1210508dyb; Tue, 30 Jan 2024 05:15:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3bGu64s3l2nZKrEqa4ACw30R6pVWqvqMZqUgUuzHA53f2Z0mYkAlmgS9kYtQeGZXO919Q X-Received: by 2002:a17:906:8888:b0:a35:2758:2278 with SMTP id ak8-20020a170906888800b00a3527582278mr6176382ejc.10.1706620526667; Tue, 30 Jan 2024 05:15:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706620526; cv=pass; d=google.com; s=arc-20160816; b=fH9uTqMFieikrcAB8yDWJZVNmn2Qiu6SegYZxmYu12S5XaT5aIdZacL3IxCgmWZY96 OOn2onDajgvpDitZaXoqK+QejHKk+0dv0QurhOQeamwVrxjYqNza/g6DpkZ/RrY+V9rR p8N5ErpFB2zfQAO2qN14oTPWu77ZaoUzTSSdSBR2UXMbMPARzGhlLcs/zmDDO+XvcqP8 njh/oAwab/J/yDm/f9E3FFxcwje8vmsoCPtwmGjhRYfwQtnOTeS/Wq0jzsFQOehzGIc3 cxW5teUW/M8fk64OSGhmlob7V5R52UxhuXS7CFPLUe1KOHFMcEk96uzBDer2gXUzTcN/ 1Qzw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44685-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id rv15-20020a17090710cf00b00a326070d9c5si4402748ejb.235.2024.01.30.05.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:15:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44685-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44685-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 492881F2310A for ; Tue, 30 Jan 2024 13:15:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 980B26EB66; Tue, 30 Jan 2024 13:14:32 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789521325461184654 X-GMAIL-MSGID: 1789521325461184654 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)); 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)