From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 86A83376467 for ; Fri, 23 Jan 2026 09:55:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162110; cv=none; b=mr3ckRjOPtT9hKvCV3QR6PVIwPZyMNawg1PgkK7j2RV2yw5YN/ge7TeRPjoZsTpHwuHvKMVwJdrB5ZbosLe2RFhDHdoAk9Qb3BWrb1Pe1xVinXP9y3pphMa4cbYMURNtMY8IBenaMt7OPYGwEfldFzyGw1oN/sqyZA+DXPse3/E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769162110; c=relaxed/simple; bh=DU9gDogXeTuASUoo65htyz+0VljGnOWR5Hym9zDQjP8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QIQTufH8REaaGo1cGzvbL6u6+lcdEqN/7NztwlZhl9gu8Wr8JNSKtT/eEQFC1qvUAgZGbKm2yudp3BsH8ITnDiBot9Z9UJXzpZGFLK8oFnrQeWqkz2MUSKNF93jQYZW9obXosKbRS5KtToBQhYCxn/Dc7ztHYNQPGVOnwmn3crE= 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=AsEzoRwu; arc=none smtp.client-ip=90.155.50.34 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="AsEzoRwu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=nYYxtSx+aGqC9+vILPtEHeY+Gnkf75+mVR9A2hW+14U=; b=AsEzoRwuIoqR0UfzLhfkGn7DiV M0MFw6e8d78IN/lO9Ozk6lN5n4AGrKZhV0Xo0lNjHqgrUiHCYuT/y5S/s5IJ15QcBTxux8gar0+gw 58+D1noLSArDOlb10qZ3cnOwbuPl+p+fg96Zq3ivlyOpw+JuOUJVgRsQTbha7WswpBonuJ4Cqx5Il bTdb9QFvzL/XSSdy+xpSZx9RAPgwrOs5yP4e9ywkX0O5O+7PSzT1hqff+CXn1hDFtVxR/tjnK9lCt 1+hmR4PMGWnFREq+aEyGCidKMzh8iNIHCK0Getxs7t0j5W8DVrZsJyCpy2tlCWCqObQKQ673Hb1wb jbkjlMvg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjDsW-00000001b8v-1Afg; Fri, 23 Jan 2026 09:54:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id D3C1C3007E1; Fri, 23 Jan 2026 10:54:55 +0100 (CET) Date: Fri, 23 Jan 2026 10:54:55 +0100 From: Peter Zijlstra To: K Prateek Nayak Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , linux-kernel@vger.kernel.org, Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Chen Yu , Shrikanth Hegde , "Gautham R. Shenoy" Subject: Re: [PATCH v3 0/8] sched/topology: Optimize sd->shared allocation Message-ID: <20260123095455.GI171111@noisy.programming.kicks-ass.net> References: <20260120113246.27987-1-kprateek.nayak@amd.com> <20260121161653.GH166857@noisy.programming.kicks-ass.net> <34ec710f-848a-4f8d-9dac-f9419e9b9c07@amd.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: <34ec710f-848a-4f8d-9dac-f9419e9b9c07@amd.com> On Thu, Jan 22, 2026 at 08:26:29AM +0530, K Prateek Nayak wrote: > Hello Peter, > > On 1/21/2026 9:46 PM, Peter Zijlstra wrote: > > On Tue, Jan 20, 2026 at 11:32:38AM +0000, K Prateek Nayak wrote: > > > >> "sd->shared" is only allocated for the topmost SD_SHARE_LLC domain and > >> the topology layer uses the sched domain degeneration path to pass the > >> reference to the final "sd_llc" domain. > > > > I'm fairly sure we've had patches that introduced it for other levels at > > various times, but clearly none of those ever made it. > > > > Anyway, a quick peek seems to suggest it is still easy to extend. > > > > > >> include/linux/sched/topology.h | 1 - > >> kernel/sched/fair.c | 62 +++++++----------- > >> kernel/sched/sched.h | 2 +- > >> kernel/sched/topology.c | 111 ++++++++++++++++++++++----------- > >> 4 files changed, 101 insertions(+), 75 deletions(-) > > > > Is this really worth the extra lines though? > > The larger plan was to move the "nohz.idle_cpus" tracking into the > sched_domain_shared instance which will bloat these allocations. > > Instead of (#CPUs x #topology_levels) surplus, most of which will get > reclaimed at the end anyways, we'll only have #CPUs worth of > allocations now. Fair enough I suppose. Be sure to call this out as the primary reason for doing this.