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 C153033D512 for ; Fri, 20 Feb 2026 10:46:10 +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=1771584372; cv=none; b=CzYByTspJToyIOUYMDz9XvdsLfyh6A/D1hgvuUUn7/cHVsKWwf3uHs6AIZQnIhUvi4+XC74fQMexaJUoWkvKkSJX4W3gNW+AW3ObZEovWn2sHeXLfxHLLG3m3oMlW7wZ3bTEr49DhnLVDp6Ni6YIQnAV9FNUUw0ivHze7r4DUQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771584372; c=relaxed/simple; bh=j8yClexjBJITqU8oTdorhEIO/BYf71as12fl7wT83u0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eSzTc2rqDrjVkl1j2NSHo12Dz8LBWSD6ldXkN+QTU1qfcnyvCo/jEBxply0QjyxbBUxKC/bsWb33qeVW8iTKLszkecIhnizaSIJhVBckTfUH2aLLcIK8HHCMetuVqLdIPwcrHGORJ0z/TgLvU45/+s85dLd6NSRuVIzEukm+FbE= 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=KzzJRGeA; 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="KzzJRGeA" 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=1rE6q9/68ghEzIy/vaOHGXB4lP0Ct6T0NVC0cns77H4=; b=KzzJRGeAO7amY+IjMwbhBr4Sis rufP2ISs/Ib7oTniAZsyr9yb1uic8hAmoqJWfeIDhEZbGAvlf132XcvLbYaFruNYST0taGj/s9iXU UMtIPAheH03Bao0rvuuIo35UE7XHVIphXHCvq2gk1WRyY/csA+QVqgSIbLr0clrK9Jm81xKiFNvoA Bdg6DrKL5OpdlWZuZ2afwA0mg+DbBFq30p7KdnPa1e/OijdAdbo6au6xVDkK9CKt4qItObogukoaP hfJ/u49m+Wd8jKkbcfNzeaxFRMaeLIUPOIyNhkpDGbKutm5HuomIkGsGQJ2xmDjW6GzjcwlT3RgFq snLDFkhw==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700: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 1vtO0s-00000002UWg-2LcC; Fri, 20 Feb 2026 10:45:34 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 53ABF3030B3; Fri, 20 Feb 2026 11:45:33 +0100 (CET) Date: Fri, 20 Feb 2026 11:45:33 +0100 From: Peter Zijlstra To: Tim Chen Cc: Ingo Molnar , K Prateek Nayak , "Gautham R . Shenoy" , Vincent Guittot , 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 , Chen Yu , Adam Li , Aaron Lu , Tim Chen , Josh Don , Gavin Guo , Qais Yousef , Libo Chen , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 07/21] sched/cache: Introduce per CPU's tasks LLC preference counter Message-ID: <20260220104533.GO1395266@noisy.programming.kicks-ass.net> References: 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: On Tue, Feb 10, 2026 at 02:18:47PM -0800, Tim Chen wrote: > diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h > index a4e2fb31f2fd..3aa6c101b2e4 100644 > --- a/include/linux/sched/topology.h > +++ b/include/linux/sched/topology.h > @@ -102,6 +102,10 @@ struct sched_domain { > u64 max_newidle_lb_cost; > unsigned long last_decay_max_lb_cost; > > +#ifdef CONFIG_SCHED_CACHE > + unsigned int *pf; So I'm all for short names; but perhaps this could be better. When reading this my brain went page-fault, and then WTF :-) > +#endif > + > #ifdef CONFIG_SCHEDSTATS > /* sched_balance_rq() stats */ > unsigned int lb_count[CPU_MAX_IDLE_TYPES]; > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index ca46b5cf7f78..dae78b5915a7 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -2723,6 +2778,13 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att > } > rcu_read_unlock(); > > + /* > + * Ensure we see enlarged sd->pf when we use new llc_ids and > + * bigger max_llcs. > + */ > + smp_mb(); > + max_llcs = tl_max_llcs; This seems wrong. This is *after* cpu_attach_domain() which publishes @sd. How about you do something like: struct sched_domain { ... unsigned int llc_max; unsigned int *llc_counts __counted_by(llc_max); } Then you always carry matching information that is published together. > if (has_asym) > static_branch_inc_cpuslocked(&sched_asym_cpucapacity); > > -- > 2.32.0 >