From patchwork Sat Feb 10 11:39:19 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: 199246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1419362dyd; Sat, 10 Feb 2024 03:36:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGF+xFZXPPJJzIoZuAr+AiZp/NUQS292XGEZeWPPcdJxMAHtk4wTqZH96BMn2k26lpugtc X-Received: by 2002:a17:906:28cf:b0:a3c:1d36:62c9 with SMTP id p15-20020a17090628cf00b00a3c1d3662c9mr1234407ejd.73.1707564998560; Sat, 10 Feb 2024 03:36:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707564998; cv=pass; d=google.com; s=arc-20160816; b=eGsNuuDaQfCxxo57lBZOeM53dKmAER7bg1kt5/k3g6Mubm2p9zDi6YXMiksUcf+ZEd +loNBJSf4Ve6v188BxGULluUNJA0eYPeVvVcUbuA8Xr+uzP4IrY5g49ChaBZAIeoelBS I44PpB2mlZQKN/ppv9v4Ib9QI4itoUiANqWcBSkdI9/AlOKhz1u4KMkGq+0Cp1X3tZ6q oIDtbVdmgwOuLUQy/SWEdeU8V2o+J3THPr4R4T1rwcMDTO42g9l1St+r7lneTew1dNSC AQAGyBHtLYJYzaPbz+YcXYHAGvtfPxevXtl+PkgKhV/b8AOVSiDY8uWutWAY1RVW3Ey3 5wpw== 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=KG+DWqhiwRrnGrZXzj1dt+rgsxkalfsLYkjdeJZKuZ8=; fh=qi1ASFWNcUTwFoJj8tfhZWd0PinvUrG6KvhabGl2yv8=; b=EGa8QSwRL9Oegr0DbFUlRVVjfELKDTs5RJzRNwgQa9y7ZS6h7OyE3WdzmGTLOa+kEl sYaM0adV60+sNH/zoXyHOakE+HnytcFidWSXoOGOJtRW7BIe1utWWGLHJWya6jcRSdll TQwqe1BkzV+N/xwqHVt/9+pSmSg9pNBpcOQxN6y8qUi/HiTaCrvvWhUYFaCg1JBAdYSR NDknzvTt5SLCysdnArULJzrlxHYzYU6t4JagiHJxyydlxbQorKFebbBGKbKNuaauXhsQ XiJsuHKWw5lovQbr7fzsYRICSovcDzBB6KaN2kldszCplTEhLyio7SyvlGXiolrMvrQO bDwg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eLaly24H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60378-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUF55odh/3owQn4JTCzsxVCbwOP8SC1CMgjRe+GY44yaz9Eqqf0ry3GMp/UIs9CJbm6eS5OMaOSH094mI53FOUlCNPX3w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v9-20020a170906338900b00a381b930bdcsi1855931eja.846.2024.02.10.03.36.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:36:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60378-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=eLaly24H; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60378-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60378-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 30E9B1F22DFC for ; Sat, 10 Feb 2024 11:36:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 700163D54E; Sat, 10 Feb 2024 11:36:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eLaly24H" 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 CF7543AC01 for ; Sat, 10 Feb 2024 11:36: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=1707564982; cv=none; b=NO4HmhsB8Yajiu74n+TGDjD25v3eqeoCQbILyJjD8Y/UQA4Xtg8Fh1NV8hhYBL7D7pUe09fVqrHhZeeYihZj8vETJ0AxfMj6KiY9ZNHAs53JpqHUl6Z3KypYwnkZhlAXM9KtEvBNPnPGgDeBvK1fhf5k3L6Wp9mzAqyitpERzBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707564982; c=relaxed/simple; bh=mofvx/4Gu5lY6rezEW+q6OTCAd/T7sEH3BGxSJ30Meg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aG9q3HvZxpDMf6GAwi7aw3Ntf5HZtzxyplIcALYFfBsD0dMXMZ89Em7hSJsdQK7J7j5APwNe+a5KYcTaTE/eiNqIP/gnsX1RuGsDEkedQf+awtjiC1zkFE0UQg5hVpCWrVdghnGONJzEH9qjBjc59wkgYY9BFuiuijvxjiknYU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eLaly24H; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 641BDC433C7; Sat, 10 Feb 2024 11:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707564982; bh=mofvx/4Gu5lY6rezEW+q6OTCAd/T7sEH3BGxSJ30Meg=; h=From:To:Cc:Subject:Date:From; b=eLaly24HIsgzoTZ/SX6JRFlF4EusLbDp9ivgIHzCcbK8b02h03T/I7yvYhGw+UZg9 vjM3VGwFKd/yGWA9vBmdDdaH7lFBWHrBRicIi4DgZoPuGtvTRhJOFmhVS9LRfJcTNI KWqmn0844+4aenw8yz3xh3Ir0/57DQLURgX4CfE9Bdc+06jKcnJL2QVujb2WfuRV9N l5QByd3tMoFnOcYwOQgtwhWOtffyxg/IMKFdunAo1GbrADy2rqdlBkQxncAlt2rvpT nm9ZHBTjROq9sFO0NudnSJkOUZQ1jnrIxRgfNeXe5MsrY7kyMUy4L8tjaVoLBHq5xO lq5DHK65LxNXQ== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER) Cc: Alex Shi , Ricardo Neri Subject: [PATCH v5 1/5] sched/topology: Remove duplicate descriptions from TOPOLOGY_SD_FLAGS Date: Sat, 10 Feb 2024 19:39:19 +0800 Message-ID: <20240210113924.1130448-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: 1790511675828965157 X-GMAIL-MSGID: 1790511675828965157 From: Alex Shi These flags are already documented in include/linux/sched/sd_flags.h. Also, add missing SD_CLUSTER and keep the comment on SD_ASYM_PACKING as it is a special case. Suggested-by: Ricardo Neri Signed-off-by: Alex Shi Cc: Valentin Schneider Cc: Vincent Guittot Cc: Juri Lelli Cc: Peter Zijlstra Cc: Ingo Molnar Reviewed-by: Ricardo Neri Reviewed-by: Valentin Schneider Reviewed-by: Vincent Guittot --- kernel/sched/topology.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 10d1391e7416..0b33f7b05d21 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1551,11 +1551,12 @@ static struct cpumask ***sched_domains_numa_masks; * * These flags are purely descriptive of the topology and do not prescribe * behaviour. Behaviour is artificial and mapped in the below sd_init() - * function: + * function. For details, see include/linux/sched/sd_flags.h. * - * SD_SHARE_CPUCAPACITY - describes SMT topologies - * SD_SHARE_PKG_RESOURCES - describes shared caches - * SD_NUMA - describes NUMA topologies + * SD_SHARE_CPUCAPACITY + * SD_SHARE_PKG_RESOURCES + * SD_CLUSTER + * SD_NUMA * * Odd one out, which beside describing the topology has a quirk also * prescribes the desired behaviour that goes along with it: From patchwork Sat Feb 10 11:39:20 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: 199247 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1419469dyd; Sat, 10 Feb 2024 03:36:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUUjALCu//P18qYm58BhT374IjPzWVZAHeK5nvf8FiMN2yW6cXJZWWCDpsn6U7h21DaGrR X-Received: by 2002:a17:902:d4c7:b0:1da:1fe7:cacf with SMTP id o7-20020a170902d4c700b001da1fe7cacfmr1487968plg.25.1707565014839; Sat, 10 Feb 2024 03:36:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707565014; cv=pass; d=google.com; s=arc-20160816; b=V59edxv65RxKDrVNT3rTHVKfyaJ4Q5/zRpFLqGfAIJ94r7mZV7f3wNwvfx6GPJ97XF Zh3tXKGnOIjuMlGEJR7gI/1F0FzPdlBHgHguQP5e1ADU03ecUd6iQljHAnerNfVCtNDv b9HE2sEzPljsuc74AwbdAmdh7E15CzFoyM00/1BBEKA35X4RdiDoM4vUeR5GlAmWjE+7 yD14IbKgKANP1AAAxFgMiUpoHBnulZNKDizATOFtCpUWaK12mLe+rIXi6VKQXQbYcY0n LjwaJpbI4ie6S2KoaYC7wTLCIotDKwxj+zt8LxExZlnTCymRguOW0iu5Iim8sjXrlbvU 2Fwg== 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=2zXrBne7L3hc/8fZipQuiagtiGBJgCDJh+CpJH/d15s=; fh=U32FKqTQNnryy9py00ad1EyMsaAmWRdamDYapiKWa8Q=; b=HhS2Fnwz/JIRZ9YCAcKAso6X1r9MZ37bijz6Kh467LUTihnjmJAr2XE7tLXfvTVz4O LmWKM/tDoMZqmuBbwzrGnoBfWuQP7I9LVGUeIHEOHMGYHPooxUAOf5LSUJQt+TzDzMfq bzN8wIYD+NfLljf9efmUOjCN5PWiD0sCK4TdUqXAl25Z90vj/eIGRykMBnue45JXrDee 1X6Uq+Juqotxh5DCf8M/GMMcjIkcKc7wjJz4tZBTyKYUaxSSpejmttT6MojXymMaL3lF y458NmAYANRxGT4F2COyk3d18QwPj8Mxep83zbz2By805VRsznKcmeO0RCT6shZ7ok4v ldrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ox5pYG88; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60379-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60379-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWSbCPNJU4mBrMok7m+IKypeHUfQBZk9+k/+giwWBaEGZzCrBvP30L4QhtvYlTBrPIz6NIPMNNMe0d5bp/8rIAo1CCqCA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e5-20020a17090301c500b001d78f9081a9si3345602plh.313.2024.02.10.03.36.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:36:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60379-ouuuleilei=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=Ox5pYG88; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60379-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60379-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 AA1A5B23420 for ; Sat, 10 Feb 2024 11:36:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 013413D577; Sat, 10 Feb 2024 11:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ox5pYG88" 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 5FFC33D55A for ; Sat, 10 Feb 2024 11:36: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=1707564986; cv=none; b=eKtS/Lclhm/odPbZgpgM9CY9M3T4dSshpm029E9pLOFOMz8VjihzipiaSgQGAD3d6V/kdO4YKjhoFW6hQz0fx6wuu9+R4kYJDqmFbNL+jFWbDK3SRBFgApWL7wgJtgsrLqA9gAttvhS/a/GWPNqWGnDAjJjubUflL7D/4P0LmHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707564986; c=relaxed/simple; bh=GN38axMpDXwM+LiQWv9rCHV4je3GH/IUMqqcPRYdILM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tbvyYeIytnmikZLRFMQutzW/D1N2haLc/bfAYs/f8p2dJ4h81MwgF+OwTNyFm53hytUVpCTrQrCM1rtH6rP3JjiwBv3ifkLNxLoM4rtXCS/eCvNO6ynoy/unmU3a/dQvL8XQnyEKeDm/U/+S8dTF1Nn8Ld7VF8ZsEUrDMb3CHU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ox5pYG88; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00256C43390; Sat, 10 Feb 2024 11:36:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707564985; bh=GN38axMpDXwM+LiQWv9rCHV4je3GH/IUMqqcPRYdILM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ox5pYG88JOmXeQa3kRbicKLfW7BrjOnejepA6G+79dw76I8L4Zb9sPD1+wnHMYSgV le+MqIeltleerizblAE4U/xg/PtbQ9wKTzCrpfaBtBV7gvBlbB4nnGMG5pOsJbhfUC R0njwsf+sv4BhUCJXGSMCwvgjcLRyiuBoU1TKrbTrtRpJqaBoQI0n9z+D9nqkH3o2N mBnkpu4xB0WwOkTNl7GqySpAgao/asJeUH2visJksyhpzHdgeN/sx/Sb0D+yhsDavW o8wnX6SkAhmn+PX6GKYL+eRt6smqAn2OKm1va9lOx63m2m83gfdW/KkcSjYds+JDJM GDqEePBQ4EKZQ== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER), Ricardo Neri Cc: Alex Shi Subject: [PATCH v5 2/5] sched/fair: Remove unused parameters Date: Sat, 10 Feb 2024 19:39:20 +0800 Message-ID: <20240210113924.1130448-2-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210113924.1130448-1-alexs@kernel.org> References: <20240210113924.1130448-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: 1790511692873565231 X-GMAIL-MSGID: 1790511692873565231 From: Alex Shi The argument sds is not used in function sched_asym(). Remove it. Fixes: c9ca07886aaa ("sched/fair: Do not even the number of busy CPUs via asym_packing") Signed-off-by: Alex Shi Cc: Valentin Schneider Cc: Vincent Guittot Cc: Juri Lelli Cc: Peter Zijlstra Cc: Ingo Molnar Reviewed-by: Ricardo Neri Reviewed-by: Valentin Schneider Reviewed-by: Vincent Guittot --- 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 533547e3c90a..607dc310b355 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9749,7 +9749,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 * @@ -9768,8 +9767,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)) @@ -9940,7 +9938,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 Sat Feb 10 11:39:21 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: 199248 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1419532dyd; Sat, 10 Feb 2024 03:37:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU20rPQAyjaFNH1WblXoeMpcwWsGp6M78mTudCZJTqpS6RPT218b6FKvb6KvmMFuUPdgx1J9HP89fwcT7qTrEDn/F8QQA== X-Google-Smtp-Source: AGHT+IGXAVWZ9eDZFE1CPqvTpV9eCzGg8E7Bno4HsG/lk9Xlb4NtQ9QtcGbnao1SoQ/y6HhqLnhB X-Received: by 2002:a05:6402:345a:b0:560:e5cc:63dc with SMTP id l26-20020a056402345a00b00560e5cc63dcmr1269820edc.17.1707565026019; Sat, 10 Feb 2024 03:37:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707565026; cv=pass; d=google.com; s=arc-20160816; b=zzIgOkcFzDUyeI6993X8orjwRlhyrI7WvygdZd4gFUiqyoV7QlJzGqW3dXvnOji6Xc VE83tkRfAU+mpXrzv+5nzAPYXgUQ/6E0ppbVcN9v0J+MSe470DL6jBP0GQqNgmh/578Y iRgCxsN1bsOiX/+wPmffjhWMRJLY2btvz0rnOI/DTfCOnt28IzuERLdcVhaWk3z8dRR5 57OLYTyLx6R6ze1/dTLGMxN6XlpiK9hlr8fAHnLN3/3bswjsygfUhBSWBK7APfi6YbW6 b0656OjoJx6PSmMLPFEXi9QDIgEQY39X8TuCR3u5Rh9JVq0ZOYpc5f5B9sgyTLJE2658 PkLg== 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=/Y5BxNWmnqPQPSpwm3SzHBMMx6j6jGLWJCiJIYLr7ko=; fh=nxV7MHxQdeJRdv5f9p3rrPTwyVh1icYvXS+pGMnlEfg=; b=xOYvh1c2s4xSI1e5Nhd+vikcRHOa103m6h1vfG6opKVQJcTzpv2YomFYOSbkCg8hgz hKEsojl9Ebg70W1yVvt6sbSD3A1bxNfgWZTf9l2UyT3qhYR2FJxEi0/zRGMkDdFYjx2V w7JXIHpexNR++kCWp0fso/C8c/ymfNMX2fC59QVVSU5+xtGHSyoqv+NQplh6xMY7ceCB X2A3mEPg1wMhMYW9gAymo04lBJ4e5mDlMMYwO4uptFH7zO75ILaIHCvOANYT3Jh6vQK4 l070fkoN5KN84y0Vg25Ayzllt/qnT6sgYv6J2TfWpOi5JQZ8x3tPczyU+qHtysKHinya 1xzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RPTNgJJJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60380-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWSz6kKDcY+csNFiUEqTlOyqzCEAOyOgmlthHIndppK0hBXvZzRqbUs7ULSNa42nR6NpU0LHNvBEG+rtsPs1mt1Qep6hA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z96-20020a509e69000000b0055d33a14abasi763062ede.367.2024.02.10.03.37.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:37:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60380-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=RPTNgJJJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60380-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60380-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 7B6221F24190 for ; Sat, 10 Feb 2024 11:37:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D31F63D97A; Sat, 10 Feb 2024 11:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RPTNgJJJ" 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 06C053D57A for ; Sat, 10 Feb 2024 11:36: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=1707564990; cv=none; b=SOoyJ+HsN63GZjwpUtiN3C/dy13AeIaOP9TipS53N1Zut2z3hRTyaiHEbQg19rihPTjXYMS1C44eJz/LFmP7frg23FPo80hbyNnLPz5OmaZpXpgTrjVb14fWvDoKuHGYXoWahuo6DITeAeVECPILgOAirf9eg9iAS6Bfe8Z1d1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707564990; c=relaxed/simple; bh=1Prw9eKOLc7XnYIr5gRAob0S2UL6jacinMD8Gm2WYdQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Egjk2/N/xMLrjjBokei8igllw3P9auSDbz8+azQTYGuYE1Le8mQLYjJ9pDwRIB5Kugwk8UarUoYDGiU3PVdFUk1LPyH4BwSkigGBcOPEiVbbgA266yrZHG308LLh/yOH+v3l4aXQsMSnNWGx6pChuZ7j28bqK5xSf5ZcgjNXINs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RPTNgJJJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D997C433F1; Sat, 10 Feb 2024 11:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707564989; bh=1Prw9eKOLc7XnYIr5gRAob0S2UL6jacinMD8Gm2WYdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPTNgJJJoqWOzrheU6wrV978/BrI/9/YQgRtoUDpe+kkI44Qmu6JZjehpwCk8I+oz dgjxfEjpAJM01R8qbsg3zPGoLAsaaVSVrzkvo9T1NuMNEjquY+KhPVo/EvBAcAlVQR kohn5lPFJz9UKh5TFmDnSy1YFsDB5k2ttBwNJSrwOqgWtNn5GFrxOJD14L6Yg6fufv ewvEJdXpYaAAcDZuHH82WDgSZ0lLK9BdlS6PstLRI7PgtMxVRHiEWQt4aj8ZUKEJwY Kd3eE/YHkO/TGPnC2YuwGrlNMxs3kNT7JLUMlkqsD1CxPe0N9lvD0UU+OXgQV1YJIT KZ/NoNZMlhnAg== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER) Cc: Alex Shi , Ricardo Neri Subject: [PATCH v5 3/5] sched/fair: Rework sched_use_asym_prio() and sched_asym_prefer() Date: Sat, 10 Feb 2024 19:39:21 +0800 Message-ID: <20240210113924.1130448-3-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210113924.1130448-1-alexs@kernel.org> References: <20240210113924.1130448-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: 1790511704747129173 X-GMAIL-MSGID: 1790511704747129173 From: Alex Shi sched_use_asym_prio() and sched_asym_prefer() are used together in various places. Consolidate them into a single function sched_asym(). The existing sched_group_asym() is only used when collecting statistics of a scheduling group. Rename it as sched_group_asym(), and remove the obsolete function description. This makes the code easier to read. No functional changes. Tested-by: Ricardo Neri Signed-off-by: Alex Shi Cc: Ricardo Neri Cc: Valentin Schneider Cc: Vincent Guittot Cc: Peter Zijlstra Cc: Ingo Molnar Reviewed-by: Ricardo Neri Reviewed-by: Vincent Guittot --- kernel/sched/fair.c | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 607dc310b355..426eda9eda57 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9746,8 +9746,18 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) return sd->flags & SD_SHARE_CPUCAPACITY || is_core_idle(cpu); } +static inline bool sched_asym(struct sched_domain *sd, int dst_cpu, int src_cpu) +{ + /* + * First check if @dst_cpu can do asym_packing load balance. Only do it + * if it has higher priority than @src_cpu. + */ + 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 @@ -9755,34 +9765,21 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu) * @env::dst_cpu can do asym_packing if it has higher priority than the * preferred CPU of @group. * - * SMT is a special case. If we are balancing load between cores, @env::dst_cpu - * can do asym_packing balance only if all its SMT siblings are idle. Also, it - * can only do it if @group is an SMT group and has exactly on busy CPU. Larger - * imbalances in the number of CPUS are dealt with in find_busiest_group(). - * - * If we are balancing load within an SMT core, or at PKG domain level, always - * proceed. - * * Return: true if @env::dst_cpu can do with asym_packing load balance. False * 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; - } + if ((group->flags & SD_SHARE_CPUCAPACITY) && + (sgs->group_weight - sgs->idle_cpus != 1)) + return false; - return sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu); + return 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 */ @@ -9938,7 +9935,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; } @@ -11037,8 +11034,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; @@ -11908,8 +11904,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 Sat Feb 10 11:39:22 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: 199249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1419605dyd; Sat, 10 Feb 2024 03:37:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVQQOhOqrlVZIyq4/EZhHZ18agK5IyY+Jt9sXGEfm6/feh5lHEiAxQEYltHq4pE7Vh5vvNakck5SQvuXX2y8h9CC6Ix2Q== X-Google-Smtp-Source: AGHT+IHCOh2mzFv0La+76UgxS3SdgTs488V1JfNzauqBV8JrqirwVDagl5sfcvMUCgvkzcF+5FFh X-Received: by 2002:a05:6808:1249:b0:3bf:d1ea:23bc with SMTP id o9-20020a056808124900b003bfd1ea23bcmr2041745oiv.49.1707565038711; Sat, 10 Feb 2024 03:37:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707565038; cv=pass; d=google.com; s=arc-20160816; b=fUAlPR+x9mNJVB/yMAT1TCINaskgEsqK+eIorzcu2nZnQB/hmnreX/NgqCjVYbdSwN aAH4Vo8ZQwGKxtVW5PDl+bLmRqM777KwMCt5pcTLRvTgVu/UTKvYAcBJ8paauehlPXCF HPoVJSdKp7y2Em5AZZS9nlg8wQNMa2nr8bVq9I4r3+pgXtY6rqffCHE/y490pvVX0H6S Gx8MTc676SnEnvdmSRrRyv9ENmfFIMKEEOooc36FvEpwo/6+vwvixXkrAR1Y60GGwZJu 2Dn4I1k4PklYVSTrI0rp4i1yuW9CHJ44/k8DXfJR0A3mwQZQB7Ikr3saPShWqfjWdMaF k9uA== 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=bsvNKD1rZGIfm0uMMym713VPNeccHuGfioHqVE6TDSI=; fh=TlvJMdiUK9BtNzm6kZ+N5nyi0c2TuKsZEpCyDo4V8fY=; b=Y+pDuo1VE2DpzQDWIdH+U8+EEk3AFfApPA5NzorHLM1tg32VgLemOprVB48QcrHYdZ 6T2rHAjg3zmMa6Hfxe3AL4Ely9L0IR5W5jRHycsDkhJy6ET74v/ZeEHfUVag2bipc+oF eOZ19/6hpb9/sqN2lmT2fGYD8OZPePbuaNtA1S2tXNDpk/SeYsb7zGpv02AZy2ei5njj 2mzQ9A/SUTbiFtdiKBtMDshiai1yJx0TReP2jLQuzviQ4MtQol2y/v77NZ7CSH1YrucU +ZyjaJh7G9iTym6+ERp9p2UKAysbjf37Tk1taUd/JhcyjV+DOXBJTBtJPDKHn4bO5H7g jmGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GQ6OlXpU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60381-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60381-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXC0PJ7oQLrp61A8BEFp/ECpY0qHFnfUfc7HP+AulgBZAQHkCWaI5F5wHlCzjrpl1MR2QrVidYsQrU4Gr81KCjzc8MHKw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l13-20020a0cc20d000000b0068cd84a4d53si2574618qvh.44.2024.02.10.03.37.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:37:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60381-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=GQ6OlXpU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60381-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60381-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 6B8AA1C22553 for ; Sat, 10 Feb 2024 11:37:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CF983DB9A; Sat, 10 Feb 2024 11:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GQ6OlXpU" 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 840953D986 for ; Sat, 10 Feb 2024 11:36: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=1707564993; cv=none; b=B/N7Zrq5X4AAhwuTBzdAzTWdo1D3Qh0aa8Lvf+FnBsfRXpv5zaBgr0ojNhIqgT7Qv8v397rrZ9l6NYjuNMBSI8Otue55bOyKNy1UciL8ZhLk4GcUQ+UF/xeOQ/8MwFoj7tTjBZPtjbWjc8FHHkNZI2DJZ2Hw3noaMF9PFktEZdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707564993; c=relaxed/simple; bh=oI0X6ZAibKBh5HTxaKZhT4zJgSzw5vMV8hSzj08VmQc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MljIxCwWdIusjKQnbocwq8+Azk/AuappisAMGwENgIco5WJZBWW0XlL7mgSWb4bQRoBOJM578sUFYnn10sdAMOMfhvtaSGpUxYM6uR2jb8fYVPidPafQv7dUAhxegUti6C6FNW6USa62ThRdNpVQWkrtiE8zyy8E/KB/ABMFC2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GQ6OlXpU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2686BC43390; Sat, 10 Feb 2024 11:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707564993; bh=oI0X6ZAibKBh5HTxaKZhT4zJgSzw5vMV8hSzj08VmQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQ6OlXpUx1RH+EL7QIe7bhORMXP1+/r/DwxllnGExM2GIlLJJA3sZc8Y5PXdnecxy 0n45Wr9DG/EVoCcTi3pAKJm+/kcY4RDp/eG4UweDmfopRofrlFG3yEC1QT++Uz1Qvt kOn5UIaoQupAEm/YHAO60BGMLCn2B6A6tedlPp6vjGyrtUs7qH2VwVfJsEGb+L5KSX z4hWw6RqQYXuvcnGrRU5ics1bDRp0ktQc2NoK1Ox2RV8xsGyi7qh5/uLpjdJoG7+UE 1xs5N5Za9YiHRoBnbBoXrrV0nhKZkMNu9v9jVyEFir+rlgl4OCEvDBoaZqtOzVMqJx p8z25ltPnTXhQ== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER) Cc: Alex Shi , Ricardo Neri , linux-kernel@vger.kernel.org Subject: [PATCH v5 4/5] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio() Date: Sat, 10 Feb 2024 19:39:22 +0800 Message-ID: <20240210113924.1130448-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210113924.1130448-1-alexs@kernel.org> References: <20240210113924.1130448-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: 1790511718020339741 X-GMAIL-MSGID: 1790511718020339741 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. Tested-by: Ricardo Neri Signed-off-by: Alex Shi Cc: linux-kernel@vger.kernel.org Cc: Ricardo Neri Cc: Ben Segall Cc: Steven Rostedt Cc: Dietmar Eggemann Cc: Valentin Schneider Cc: Daniel Bristot de Oliveira Cc: Vincent Guittot Cc: Juri Lelli Cc: Peter Zijlstra Cc: Ingo Molnar Reviewed-by: Ricardo Neri Reviewed-by: Vincent Guittot --- 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 426eda9eda57..cd1ec57c0b7b 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; @@ -9933,11 +9936,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)) @@ -11033,9 +11034,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) { @@ -11131,8 +11130,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)); } From patchwork Sat Feb 10 11:39:23 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: 199250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1419679dyd; Sat, 10 Feb 2024 03:37:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IEynzCiTf6w04DG6rsURRwc1Xc9JLNt2SBj96NMPzepLN4G+sBoojivp7GDj7yBLo/mCxus X-Received: by 2002:a05:6e02:106f:b0:363:cc27:714 with SMTP id q15-20020a056e02106f00b00363cc270714mr2258590ilj.28.1707565052506; Sat, 10 Feb 2024 03:37:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707565052; cv=pass; d=google.com; s=arc-20160816; b=Hilq+Vy7Uwkhsd3GGd23hkklySj5g42ZgTnce2rXdv64maxgKFqEdET158jLuSlpg+ +7RWOFyzwZA5YA4JJv8b9S+yF/XwRpeldFS6Urv3vT24tWqHNWxv01oLe4z7LjxndPf6 Rw1y3NcoNuyNSvYgd0pDqSO2qTAu4c19UJhsJvWfMN1chQery3IV5Fq3WH+/2V5lwivC iQjNMG1JzJVAeBDeBPZ7MR9YJDfREp9UNskeba2j9FZcaFDesLtwRVilG6q/VCBuVbMK IYskap+eAxshMxXKYF8fVi2iTd9sUEY++zTIJaV+d2JvHfZmwt002bpUTUKppo8RmNbR SjVQ== 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=ZQHcy0P26VUEzJfGzNdPhiDd+VC4F6+r8vtqDqwuELI=; fh=x7l2SHyzwq9qQnf+G48FNU9LK6M5ydFuuxKiYBvgHnA=; b=rPycJisxkiCMvM/4kERzWH+Q0Z28uYYf6iKmCwi8En8tIkaE6n9gqwYmzivv6JsEo1 Zhdts4Wbcd8zKtG9duIAJQU8zkitxZYaC+hXx6/whTDUb5vhFR96mnZD0fNYpCfejQdv Wia8O/H5sgGTJvehbaabcfWNL5Uxr16LmKZqbnavSs/joPFA7QHq03jRrysXuZykvT7/ QKTdWrwJymIH3vc61Ledo7XYL74zTnNU9NqWy1Dl9efq0yQO6anZlk7hrpGrSQZ/xu4Q 3Co3N0LcrSxYAr0mQxSLwOMofhN6CL5f/g4Gbb0qQ/ofyFkpifHEI9AM/+sbzkaHxYxd NrjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QnKaYv2F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60382-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXBGpZU9upJ6TgnpQ/nv9nXhM7ZcMkSovszV17MJkox2KDSsupjn2wVvGe6faSGQy4o4aAvyv/007Vo+ktBwKiDfQNhww== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r85-20020a632b58000000b005d791c0fd2esi3279587pgr.287.2024.02.10.03.37.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 03:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QnKaYv2F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-60382-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60382-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 41CE6286E75 for ; Sat, 10 Feb 2024 11:37:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EDE63CF57; Sat, 10 Feb 2024 11:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QnKaYv2F" 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 D955F3DBB7 for ; Sat, 10 Feb 2024 11:36:39 +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=1707564999; cv=none; b=sVWEpR102kKexGEtlDmRKPMrlir5C1Vxwq3tlbFUX+zdR0MEg/ESKnmOiQSXBIG5qCJu93rz2bJp/Ay/Y9A+CKklO0MhSaH4t94CDcxvtWH5zBkePbNo9E3ihW1HHjffOSV5PIzwofr7y5D/mH75KHRrviHai6pRzGbGWdEdb9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707564999; c=relaxed/simple; bh=yH8HLFxJDhQAiOdU7y5xfW2QGHOpaw69vkAcwdGw4mM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CA5EDEMzlUNKtfUWV4R6OPWz2ayekHtE6tOGSjWg7+wg9MDd2rWy48dgJlNoTF4/CzJFBQVjUlZtdCIXBoK/CEhefDfujgtwqRCI/YSTLHf8HdrXTGZ0m089qxpKQIo1pqMYv7W6MSQOVYVDfKwfN2vEBCw7ZYuslgeTf/zZrUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QnKaYv2F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDA1BC433A6; Sat, 10 Feb 2024 11:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707564999; bh=yH8HLFxJDhQAiOdU7y5xfW2QGHOpaw69vkAcwdGw4mM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnKaYv2FqkdZ9sHGV/PBZqIgHSM2tBQj08b7vVx4FxxUMddBUDL00kogD9YA58vew q0MlZfnlSC5bowrnHtEaReNabaMjFkKRTBZ0MJ2bIZOqUqZR3Gka8BhEd5IDWx1AAn VTVzNu/TxntOK0ncY++ee/a0XKbqLczHbRq+/iyOKoB9XdybKw/KGRY5Ej51nV2IbO dlWqx74/RzBr2HK0+O2++J8B0UXvKDhwB4E2hA1leFecuNXMHKSV1PP+xNKfborhvy kml2+9ZzVqNdUwjqZRpq7TcboBljDmh0N9SNUJxzltLdsvUDoZVv3JX4SvI6icz8zj U031FHXt/JBPQ== From: alexs@kernel.org To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER), Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org (open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)) Cc: Alex Shi , Ricardo Neri , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Miaohe Lin , Barry Song , Mark Rutland , Frederic Weisbecker , "Gautham R. Shenoy" , Yicong Yang , Josh Poimboeuf , Srikar Dronamraju Subject: [PATCH v5 5/5] sched: rename SD_SHARE_PKG_RESOURCES to SD_SHARE_LLC Date: Sat, 10 Feb 2024 19:39:23 +0800 Message-ID: <20240210113924.1130448-5-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240210113924.1130448-1-alexs@kernel.org> References: <20240210113924.1130448-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: 1790511732926414004 X-GMAIL-MSGID: 1790511732926414004 From: Alex Shi SD_CLUSTER shares the CPU resources like llc tags or l2 cache, that's easy confuse with SD_SHARE_PKG_RESOURCES. So let's specifical point what the latter shares: LLC. That would reduce some confusing. Suggested-by: Valentin Schneider Signed-off-by: Alex Shi Cc: linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: Miaohe Lin Cc: Barry Song Cc: Mark Rutland Cc: Frederic Weisbecker Cc: Daniel Bristot de Oliveira Cc: Ben Segall Cc: Steven Rostedt Cc: Dietmar Eggemann Cc: Juri Lelli Cc: Ingo Molnar Cc: "Naveen N. Rao" Cc: "Aneesh Kumar K.V" Cc: Christophe Leroy Cc: "Gautham R. Shenoy" Cc: Yicong Yang Cc: Ricardo Neri Cc: Josh Poimboeuf Cc: Srikar Dronamraju Cc: Valentin Schneider Cc: Nicholas Piggin Cc: Michael Ellerman Reviewed-by: Valentin Schneider Reviewed-by: Ricardo Neri Reviewed-by: Barry Song --- arch/powerpc/kernel/smp.c | 6 +++--- include/linux/sched/sd_flags.h | 4 ++-- include/linux/sched/topology.h | 6 +++--- kernel/sched/fair.c | 2 +- kernel/sched/topology.c | 28 ++++++++++++++-------------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 693334c20d07..a60e4139214b 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -984,7 +984,7 @@ static bool shared_caches __ro_after_init; /* cpumask of CPUs with asymmetric SMT dependency */ static int powerpc_smt_flags(void) { - int flags = SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; + int flags = SD_SHARE_CPUCAPACITY | SD_SHARE_LLC; if (cpu_has_feature(CPU_FTR_ASYM_SMT)) { printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n"); @@ -1010,9 +1010,9 @@ static __ro_after_init DEFINE_STATIC_KEY_FALSE(splpar_asym_pack); static int powerpc_shared_cache_flags(void) { if (static_branch_unlikely(&splpar_asym_pack)) - return SD_SHARE_PKG_RESOURCES | SD_ASYM_PACKING; + return SD_SHARE_LLC | SD_ASYM_PACKING; - return SD_SHARE_PKG_RESOURCES; + return SD_SHARE_LLC; } static int powerpc_shared_proc_flags(void) diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h index a8b28647aafc..b04a5d04dee9 100644 --- a/include/linux/sched/sd_flags.h +++ b/include/linux/sched/sd_flags.h @@ -117,13 +117,13 @@ SD_FLAG(SD_SHARE_CPUCAPACITY, SDF_SHARED_CHILD | SDF_NEEDS_GROUPS) SD_FLAG(SD_CLUSTER, SDF_NEEDS_GROUPS) /* - * Domain members share CPU package resources (i.e. caches) + * Domain members share CPU Last Level Caches * * SHARED_CHILD: Set from the base domain up until spanned CPUs no longer share * the same cache(s). * NEEDS_GROUPS: Caches are shared between groups. */ -SD_FLAG(SD_SHARE_PKG_RESOURCES, SDF_SHARED_CHILD | SDF_NEEDS_GROUPS) +SD_FLAG(SD_SHARE_LLC, SDF_SHARED_CHILD | SDF_NEEDS_GROUPS) /* * Only a single load balancing instance diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index a6e04b4a21d7..191b122158fb 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -38,21 +38,21 @@ extern const struct sd_flag_debug sd_flag_debug[]; #ifdef CONFIG_SCHED_SMT static inline int cpu_smt_flags(void) { - return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; + return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC; } #endif #ifdef CONFIG_SCHED_CLUSTER static inline int cpu_cluster_flags(void) { - return SD_CLUSTER | SD_SHARE_PKG_RESOURCES; + return SD_CLUSTER | SD_SHARE_LLC; } #endif #ifdef CONFIG_SCHED_MC static inline int cpu_core_flags(void) { - return SD_SHARE_PKG_RESOURCES; + return SD_SHARE_LLC; } #endif diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cd1ec57c0b7b..da6c77d05d07 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10687,7 +10687,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s */ if (local->group_type == group_has_spare) { if ((busiest->group_type > group_fully_busy) && - !(env->sd->flags & SD_SHARE_PKG_RESOURCES)) { + !(env->sd->flags & SD_SHARE_LLC)) { /* * If busiest is overloaded, try to fill spare * capacity. This might end up creating spare capacity diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 0b33f7b05d21..99ea5986038c 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -657,13 +657,13 @@ static void destroy_sched_domains(struct sched_domain *sd) } /* - * Keep a special pointer to the highest sched_domain that has - * SD_SHARE_PKG_RESOURCE set (Last Level Cache Domain) for this - * allows us to avoid some pointer chasing select_idle_sibling(). + * Keep a special pointer to the highest sched_domain that has SD_SHARE_LLC set + * (Last Level Cache Domain) for this allows us to avoid some pointer chasing + * select_idle_sibling(). * - * Also keep a unique ID per domain (we use the first CPU number in - * the cpumask of the domain), this allows us to quickly tell if - * two CPUs are in the same cache domain, see cpus_share_cache(). + * Also keep a unique ID per domain (we use the first CPU number in the cpumask + * of the domain), this allows us to quickly tell if two CPUs are in the same + * cache domain, see cpus_share_cache(). */ DEFINE_PER_CPU(struct sched_domain __rcu *, sd_llc); DEFINE_PER_CPU(int, sd_llc_size); @@ -684,7 +684,7 @@ static void update_top_cache_domain(int cpu) int id = cpu; int size = 1; - sd = highest_flag_domain(cpu, SD_SHARE_PKG_RESOURCES); + sd = highest_flag_domain(cpu, SD_SHARE_LLC); if (sd) { id = cpumask_first(sched_domain_span(sd)); size = cpumask_weight(sched_domain_span(sd)); @@ -1554,7 +1554,7 @@ static struct cpumask ***sched_domains_numa_masks; * function. For details, see include/linux/sched/sd_flags.h. * * SD_SHARE_CPUCAPACITY - * SD_SHARE_PKG_RESOURCES + * SD_SHARE_LLC * SD_CLUSTER * SD_NUMA * @@ -1566,7 +1566,7 @@ static struct cpumask ***sched_domains_numa_masks; #define TOPOLOGY_SD_FLAGS \ (SD_SHARE_CPUCAPACITY | \ SD_CLUSTER | \ - SD_SHARE_PKG_RESOURCES | \ + SD_SHARE_LLC | \ SD_NUMA | \ SD_ASYM_PACKING) @@ -1609,7 +1609,7 @@ sd_init(struct sched_domain_topology_level *tl, | 0*SD_BALANCE_WAKE | 1*SD_WAKE_AFFINE | 0*SD_SHARE_CPUCAPACITY - | 0*SD_SHARE_PKG_RESOURCES + | 0*SD_SHARE_LLC | 0*SD_SERIALIZE | 1*SD_PREFER_SIBLING | 0*SD_NUMA @@ -1646,7 +1646,7 @@ sd_init(struct sched_domain_topology_level *tl, if (sd->flags & SD_SHARE_CPUCAPACITY) { sd->imbalance_pct = 110; - } else if (sd->flags & SD_SHARE_PKG_RESOURCES) { + } else if (sd->flags & SD_SHARE_LLC) { sd->imbalance_pct = 117; sd->cache_nice_tries = 1; @@ -1671,7 +1671,7 @@ sd_init(struct sched_domain_topology_level *tl, * For all levels sharing cache; connect a sched_domain_shared * instance. */ - if (sd->flags & SD_SHARE_PKG_RESOURCES) { + if (sd->flags & SD_SHARE_LLC) { sd->shared = *per_cpu_ptr(sdd->sds, sd_id); atomic_inc(&sd->shared->ref); atomic_set(&sd->shared->nr_busy_cpus, sd_weight); @@ -2446,8 +2446,8 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) { struct sched_domain *child = sd->child; - if (!(sd->flags & SD_SHARE_PKG_RESOURCES) && child && - (child->flags & SD_SHARE_PKG_RESOURCES)) { + if (!(sd->flags & SD_SHARE_LLC) && child && + (child->flags & SD_SHARE_LLC)) { struct sched_domain __rcu *top_p; unsigned int nr_llcs;