Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2943594lqo; Tue, 14 May 2024 14:30:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzUY4mT0Q+FTzXjdMczIpwnhiwUStvFu2lUhHRYF0m7xPrKgxyoXnln06P4noJooOEnW8/Ais0LBfhW77NRrprVasQZOZTdcId4jx01Q== X-Google-Smtp-Source: AGHT+IH4n4Vx+iNtiQmY0o+82ogwPMrOUvRLpKVgOvN9nR+WZz427hpA+AwWOjie6W+uqIcjTG0R X-Received: by 2002:a05:6a00:2195:b0:6ec:f28b:659f with SMTP id d2e1a72fcca58-6f4e02988b7mr17266170b3a.3.1715722210374; Tue, 14 May 2024 14:30:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715722210; cv=pass; d=google.com; s=arc-20160816; b=hs7lFc+Dq/YpOG1fHD7QWpOZ5AStombN0u4pRm/dB1sWOvgnruYI7Ghf+HQti8+IcF SfClB2ecPFigH7BFTbkhUdf2q3k81LnBJpIf3RrUmbfNdE/2gLiXPxIbi2QcLcaX8JH7 sLdwBjTyKSvjc4mV6tEjYu3z0VE2V1vMnjfPOHfsa6IHC5Gdt87kbVFd1TbmWvQB4wCY 0Qk017FFbLB/ACbRivA9F5vr+q74foWLBSOtoOdLZRELkSgwP3bAaoYtu+j5OCptc+o2 CYyauHdHjcrELXxEMyGyT+Qi0Lt4yK64Ay3Yx9v+xaW7QrTPOL1mKX9C7+aI7r8K+Tzf ZTDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:cc:content-language :references:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=aLWlgahzJcaRGqUoakghQCTDX9EaszXl5pn3yfSS5as=; fh=EpErBOA9vJtWoz65xHt4/V6u+LPlg1DBcuQfGGheofY=; b=cB4T514RXl6qswQvLFOzopabfOtZGw6mkCp86jVzmdeerE/Mn8JazZS4BhZNWVIg7w Drt8zKQNyFGAJ0J6cUKoimZPTc8Zwip6Q4f5QdNXlysL3SvD67noppws5BZLOgOd4I50 SGZfgy0caVY0Y1hyrFLygTrMER1H+4Hl4JnFLHpKVNdgTcCuXQ9jngBUtRkAj09LKqYZ rUk2bFtfwjtWqv41gMn/zG4PnS2zLq4uwOzsHR3SRCyqDuE+Pt26qJmce+ZtzJ/kzLgx a72R/eKX63iSqhdFnStX3mImFWlSKbNUpmJjbpCcC/BlL4/Wp5zC439b9DJ1jpDrC8rb HGYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oA3G1sZz; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-179183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f55edsi12746507a12.297.2024.05.14.14.30.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 14:30:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=oA3G1sZz; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-179183-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr 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 9574CB22AE9 for ; Tue, 14 May 2024 21:29:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDB86181BBB; Tue, 14 May 2024 21:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="oA3G1sZz" Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDDD6181B93; Tue, 14 May 2024 21:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715722131; cv=none; b=TXr/rVyYM4FTxZ9swnsnEDBrUSg0l7ys9WwOUuWSx81NpXwL1xWHQrotz9nP0GWZouTq0kyNBK3AIfmpiErQjFMB/qpF8VyAQKvRArt2vwA2cvnJ9PaehKntNlP0M2jZpFAqufTKfo1yVjBSz21mLladiGGtjakRxAVat+vxhyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715722131; c=relaxed/simple; bh=HlmV3fYfS862Gw2Y44V0T78NlarxsqVus5X9aOaYhbM=; h=Message-ID:Date:MIME-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type; b=IBwoMkmdklGneIfTo2OGspfr/D/0AuUXgPuiEt1rFcQ/SiLZwzM+W4AxjB4PvsME2I/hC6FkDjCCNTCe582Yh25bu9I0fiZXTyk38ib2t42ZKXEZHCxOthva1bZK65W87ezr8Sfcwb9yQI1908gLxaA51HzYsx7dnEpxwW6rhco= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=oA3G1sZz; arc=none smtp.client-ip=80.12.242.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.37] ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 6z8usemhMGAMZ6z8us6Qwc; Tue, 14 May 2024 22:53:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715719986; bh=aLWlgahzJcaRGqUoakghQCTDX9EaszXl5pn3yfSS5as=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=oA3G1sZzCQhftt1mEv+keu25rsjPFSjtCQ9ned9HKtiM/yL6JVkKpoW45o0E5f2fj gEWLKMW/7Q692b2/vVAB6IM5e1mJVg79qaNCceq17RnEe7omto1u3Ow+d4RG4RoipT Aq5qqZFnOKLd/bMiho/vkF4OweOFJqOwVInw8+OaKmI9ibR34aEiB6QccmWTAj+RZC rIexraXe7uHNGSbE2ojyX4a+47UjKENSXbOvPVULZsGemzPGs86vjgZdnBw0tTDYRs 6nkW+MuNc0b+dOWDRbJlJGlGnkmNTRX1EW7Pcpu6teGxXF6/7h248i2jbyzIeJ6EEg TJYe7foJbHwCA== X-ME-Helo: [192.168.1.37] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 14 May 2024 22:53:06 +0200 X-ME-IP: 86.243.17.157 Message-ID: <9fb7adfc-701b-427c-a08e-a007e3159601@wanadoo.fr> Date: Tue, 14 May 2024 22:53:00 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/6] sched/topology: optimize topology_span_sane() To: Yury Norov References: <20240513220146.1461457-1-yury.norov@gmail.com> <20240513220146.1461457-3-yury.norov@gmail.com> Content-Language: en-MW Cc: anna-maria@linutronix.de, bristot@redhat.com, bsegall@google.com, cgroups@vger.kernel.org, dietmar.eggemann@arm.com, frederic@kernel.org, gregkh@linuxfoundation.org, hannes@cmpxchg.org, imran.f.khan@oracle.com, juri.lelli@redhat.com, leobras@redhat.com, linux-kernel@vger.kernel.org, lizefan.x@bytedance.com, longman@redhat.com, mgorman@suse.de, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, rafael@kernel.org, riel@surriel.com, rostedt@goodmis.org, tglx@linutronix.de, tj@kernel.org, vincent.guittot@linaro.org, vschneid@redhat.com From: Christophe JAILLET In-Reply-To: <20240513220146.1461457-3-yury.norov@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 14/05/2024 à 00:01, Yury Norov a écrit : > The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i), > even though cpu != i. In such case, cpumask_equal() would always return > true, and we can proceed to the next CPU immediately. > > Signed-off-by: Yury Norov > --- > kernel/sched/topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 99ea5986038c..eb9eb17b0efa 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -2360,7 +2360,7 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl, > * breaks the linking done for an earlier span. > */ > for_each_cpu(i, cpu_map) { > - if (i == cpu) > + if (i == cpu || tl->mask(cpu) == tl->mask(i)) > continue; > /* > * We should 'and' all those masks with 'cpu_map' to exactly Hi, does it make sense to pre-compute tl->mask(cpu) outside the for_each_cpu()? CJ