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 AEDE23446B7 for ; Fri, 20 Feb 2026 12:53:27 +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=1771592010; cv=none; b=cGPdpz0njLG2sWixxV7OmRidKlc0PpGzJ6tOwJXrIWtzTX76cBhscDzzDKrmmbmMRdhJXvQPByDq05j+dc+iojd7FVbmDDu4+R1IhYlO4Onl1tFS9A4/iXA/rb2l5oRfdxIT6nntV1edf7tQg5omKFcj88VpNeN4AYZhbSnrwfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771592010; c=relaxed/simple; bh=iiT19OiGl44hcXZH24mkYbapFgfjsiggIaYdgvuqMSM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=svDOWkoK49mKUo4R3SAn9o+ul4nsWc39876z7l0yd3gyth+p/aHSDXD9bC/dtbZCHDAWTYzwTGXNzLQOxpZoLk4NiswDE2taDWmhZwt8o0z4WswgUKBSWu36FUgu/JpNbnTGrZ0bfIqo8k4XNSDu4wVSpbxLjO7noyUZHxMQOYA= 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=PMsypg0J; 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="PMsypg0J" 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=c8ztGOEapH8EmRXWvZFKv7lJ7GF2xRb0S2fD2WD8dWQ=; b=PMsypg0JcVVhJ7/P4SaFZGVyks sIX8/oYWHoNlL8XXKtHl0yWG6rUti0TKmGQUM5eNruBp5UsjkHVofenSySJeh5CXMG0h8WFcyQjrr /Ssi1rl2tF21tlbCvwJgjZ53eXVZUMZ1rL16IWqfPynGMoEiRs00IS4mU1rtnNewK1UlKmxqQCiUq /+0tp0jtV7tbWER9PW8I2lKJ0RCg+57GSQ5/tVTflw4CVPdQPOCZhYwhr+CM8h+ht14/4H0PAdVB7 c/V8/u3lwHBh3kNFbo7s00oHDmhMkZ1ABDCHtQzycJ9OKJ+CoWG/ZTV0B2wOJZPm4IbTkqvK/NI5S EYdRjFGA==; 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 1vtQ01-00000009UTv-1XUp; Fri, 20 Feb 2026 12:52:49 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6A02B301BD5; Fri, 20 Feb 2026 13:52:48 +0100 (CET) Date: Fri, 20 Feb 2026 13:52:48 +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 09/21] sched/cache: Count tasks prefering destination LLC in a sched group Message-ID: <20260220125248.GQ1395266@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:49PM -0800, Tim Chen wrote: > @@ -11034,6 +11037,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, > { > int i, nr_running, local_group, sd_flags = env->sd->flags; > bool balancing_at_rd = !env->sd->parent; > +#ifdef CONFIG_SCHED_CACHE > + int dst_llc = llc_id(env->dst_cpu); > +#endif > > memset(sgs, 0, sizeof(*sgs)); > > @@ -11054,6 +11060,15 @@ static inline void update_sg_lb_stats(struct lb_env *env, > if (cpu_overutilized(i)) > *sg_overutilized = 1; > > +#ifdef CONFIG_SCHED_CACHE > + if (sched_cache_enabled() && llc_id(i) != dst_llc) { If you write that like: if (sched_cache_enabled && llc_id(i) != llc_id(env->dst_cpu)) You can get rid of that dst_llc variable, but more importantly its ifdeffery. > + struct sched_domain *sd_tmp = rcu_dereference(rq->sd); > + > + if (valid_llc_buf(sd_tmp, dst_llc)) > + sgs->nr_pref_dst_llc += sd_tmp->pf[dst_llc]; > + } > +#endif