From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6C633221F39 for ; Thu, 9 Apr 2026 13:38:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775741904; cv=none; b=pe1pDnYDIOVCXzMi8CvBZ9XwDc661xbleSzLnCQM7zEm17rgJFzbgBhyP5AJYYTi9Y0qATioiSxDwO+NJinOJE7gVcxMxmn2QROTyIgJagarvL8vBN5bEc3+Q1s9WhSzao1GngvLQTW8vROxRX8YpjSPL4tqA3sQo1J1+ZJfep4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775741904; c=relaxed/simple; bh=vQKutqelrEwD4Qvz5oYuM5LT2zTFV6ZQB9mtQOb8Ufs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rEy+4uMtH+NV4U6Td9k5pm7G681hvDSNHdQPy17Jpn2c6kU9xsEMd8onYguraORjTCeQVGWLs8EZW+EPSsAgjMF6LwMjUlIf9HlHNmGpG8fzPkWse83Q/0hTuE2JTKwJwGNxp/Zi4cZDOmG3/U2VemTSHtHwBvgxUT+752ZLkY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=a3750R/x; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="a3750R/x" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wa4mOrjkqSBPyREvBBjRf4SHAJmmklvjjqDZF3fwG8A=; b=a3750R/xfURdbx2FLTY6em9wRO TIqdaWbwlSve4WaDi2Z1YmOQ9ExHmijFALa1LvVMhMp/1mOlDEhy2GlZCw3zrcSnpmzPWdewOSCBK CqGFNPGl3+3fpyvkMg/86LNHeXqfImkU2KRkOw/L21nG4QQ3/dpqgIiDdqxIgXsohdvW/xbqMONkI gAfIr4jIhmM6rNlM/ry2Go363Dlw89d8TzJKCrzLmIwFK8aSSl/lY9KqU2chUob6DxneRUQ970+nC BycAT2UAhff+FjUp5lohhopDkVhRd89+DY+It8pwE4bH4hByZS9JD65x/wnpzI3TA20fjw0LY9IDC B4Rt0W2g==; Received: from 2001-1c00-8d85-4b00-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:4b00:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1wApa0-0000000BnQ4-0ZDv; Thu, 09 Apr 2026 13:37:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DAD41302431; Thu, 09 Apr 2026 15:37:54 +0200 (CEST) Date: Thu, 9 Apr 2026 15:37:54 +0200 From: Peter Zijlstra To: Tim Chen Cc: Ingo Molnar , K Prateek Nayak , "Gautham R . Shenoy" , Vincent Guittot , Chen Yu , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Madadi Vineeth Reddy , Hillf Danton , Shrikanth Hegde , Jianyong Wu , Yangyu Chen , Tingyin Duan , Vern Hao , Vern Hao , Len Brown , Aubrey Li , Zhao Liu , Chen Yu , Adam Li , Aaron Lu , Tim Chen , Josh Don , Gavin Guo , Qais Yousef , Libo Chen , linux-kernel@vger.kernel.org Subject: Re: [Patch v4 18/22] sched/cache: Enable cache aware scheduling for multi LLCs NUMA node Message-ID: <20260409133754.GD3126523@noisy.programming.kicks-ass.net> References: <71972e12ab4f08aff422b31e34df09bdbd94de84.1775065312.git.tim.c.chen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71972e12ab4f08aff422b31e34df09bdbd94de84.1775065312.git.tim.c.chen@linux.intel.com> On Wed, Apr 01, 2026 at 02:52:30PM -0700, Tim Chen wrote: > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 995a42cb4697..0b1fc1b0709d 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -809,6 +809,7 @@ enum s_alloc { > }; > > #ifdef CONFIG_SCHED_CACHE > +DEFINE_STATIC_KEY_FALSE(sched_cache_present); > static bool alloc_sd_llc(const struct cpumask *cpu_map, > struct s_data *d) > { > @@ -2674,6 +2675,7 @@ static int > build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *attr) > { > enum s_alloc alloc_state = sa_none; > + bool has_multi_llcs = false; > struct sched_domain *sd; > struct s_data d; > struct rq *rq = NULL; > @@ -2784,10 +2786,12 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att > * between LLCs and memory channels. > */ > nr_llcs = sd->span_weight / child->span_weight; > - if (nr_llcs == 1) > + if (nr_llcs == 1) { > imb = sd->span_weight >> 3; > - else > + } else { > imb = nr_llcs; > + has_multi_llcs = true; > + } > imb = max(1U, imb); > sd->imb_numa_nr = imb; > Well that all don't apply :/ Also, this seems sub-optimal, we can have multi-llc without NUMA. Doesn't the LLC domain having a parent more or less imply there being multiple and we should be doing this, irrespective of having NUMA?