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 80F9E2F7449 for ; Thu, 11 Dec 2025 10:32:37 +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=1765449162; cv=none; b=nj1V7BwLA0QmLFEY0AUbukG9OF1aFqQunQP0f2wyZnV74VHg/qJu+iMCq0+c4qfHF0PDkVSHE0uMFznishkqdEnfRu6OkjqfMelZEy5kYk5kVz/LxbjvuSKFmE7dfu6qoAhGyJgdZabEbtSXajNFCPX4XdFyzNWebr4socWVsKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765449162; c=relaxed/simple; bh=PK1hipW1ceQekWpd3WAevc3MIqsjnoYIEaJa2Ai5VL8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XQE0lLp5rlfPI7V8kO+BkI6TGH4+e/aK1ukicaeF2VZRgI50vLcnwmXVmLZesFuj1kNE86JK/eskL0YTy3haN/srnrl1BnMhzURv7vyhWzDivxue+dQgXaes3S2S0B8MkdvHA/SUchLAi2St3wifyEGNzbwsKJZwoFZE9/VlGxY= 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=pT6zpXpJ; 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="pT6zpXpJ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=yt6nYkaduKhBH1TmLLUJw2jDhCUnf33yHXkMwrhx/eU=; b=pT6zpXpJf9u8ta0kecOpju8cau /0HZjg0Ox+Q8/wLbPb2L1mhFcWWY4p6Dg2DMMZZu7gQOseB020a41jtkDYt6WNNJ18V495cNYYCzE KUPML3RlDgw02jSMBPmVs12z1Ink/uwKIXhOt2kRachiMP4mV/OvXcZ4U6evWsvaD0cJEprdByMvw LoSkKafSeTDhvb9VlOw0aaon7w7KBIMCa88EjDeEfEldgJlC06twosI9jPp31SyUSEPBdh74bVh4H R3AQB+1IM+9gX2pT5tklexd20TVoc/s2ewF+mvcdDrb85qM7TIo2N6EwPHzIyD92D4wcCE5ZrTe9W uvQDl0DA==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vTd6A-0000000ElhJ-390i; Thu, 11 Dec 2025 09:36:35 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id AE65F30301A; Thu, 11 Dec 2025 11:31:50 +0100 (CET) Date: Thu, 11 Dec 2025 11:31:50 +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 , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 07/23] sched/cache: Introduce per runqueue task LLC preference counter Message-ID: <20251211103150.GA3707891@noisy.programming.kicks-ass.net> References: <63091f7ca7bb473fbc176af86a87d27a07a6e149.1764801860.git.tim.c.chen@linux.intel.com> <20251210125114.GS3707891@noisy.programming.kicks-ass.net> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Dec 10, 2025 at 10:49:14AM -0800, Tim Chen wrote: > On Wed, 2025-12-10 at 13:51 +0100, Peter Zijlstra wrote: > > On Wed, Dec 03, 2025 at 03:07:26PM -0800, Tim Chen wrote: > > Would it perhaps be easier to stick this thing in rq->sd rather than in > > rq->nr_pref_llc. That way it automagically switches with the 'new' > > domain. And then, with a bit of care, a singe load-balance pass should > > see a consistent view (there should not be reloads of rq->sd -- which > > will be a bit of an audit I suppose). > > We need nr_pref_llc information at the runqueue level because the load balancer  > must identify which specific rq has the largest number of tasks that  > prefer a given destination LLC. If we move the counter to the LLC’s sd  > level, we would only know the aggregate number of tasks in the entire LLC  > that prefer that destination—not which rq they reside on. Without per-rq  > counts, we would not be able to select the correct source rq to pull tasks from. > > The only way this could work at the LLC-sd level is if all CPUs within  > the LLC shared a single runqueue, which is not the case today. > > Let me know if I understand your comments correctly. So the sched_domain instances are per-cpu (hence the need for sched_domain_shared). So irrespective of what level you stick them at (I was thinking the bottom most, but it really doesn't matter) they will be per CPU.