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 867C13D76 for ; Fri, 20 Feb 2026 18:39:18 +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=1771612762; cv=none; b=GUr14ChWLwjdZuwo/bWepNzFibJqTAR9eYnyd3YxVA3YyrDTfDSz/uQQnI6zpG2X2Qq17iewTVX/EKgpGk87xwm2V4c0X1JlAXGjt/vgMlx6fSlRpjAvAW8+tY2Wf8lV+Eib16jtu1fL3l5JTIN/KLuHwFDIUDKuLtd74DK+7+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771612762; c=relaxed/simple; bh=Z2ePouCVCwAAi/Q7VXBQH9sRJ72TyEM/zM6M0uVmjtA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hZmNjxGyInh34+zDMjuZAr4KtE6DlKv2oQKn89NaxSwDkPrN7IwGlRRR9mU1baUpFjrdeEHzpkV8w3uvfzMaY80YQD8aMDHPzo3BaVapiK7/vBB2vj9PU9+y/CSKL1fAGPP+w3bUeI4LjCkkZYIfzEHAL9qslEPTzGKwDoMqfag= 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=BPt00CO0; 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="BPt00CO0" 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=tK61H32Q3ZCfEUKYZJEx7Q7lr8pn3zA1o7Y+UBvUrJE=; b=BPt00CO0BYlkOZIgb2Pw5JLvt0 6t80emQGT3yAZs46KqOruZm79eA5uSluYiUR2y4wkeNrGxL36YymvVnB4E9naAg0S7O0/LaMg+XZ9 8LNQ5Rnl7VUya0aO0FEku5Rl2zvNCmLJFWY3RWizYvVCGOU7zcv1oX7u1Ln4lMQ9zNwbKePAt/MHQ lmrzlMPlV7U2d/SzPIgrYuQqxinaCBiEebkdoKBRhpAsCfbulpeC8dtAWac9+cH0L12LyAeedSYTQ eb5Stbpx5C82OOYo9XVZNKIxAkvqGyv1iMe9trRDwIoal3HDp4n2i3CY0TURobbel4JX1ye24LTan 7wzlOJ3A==; 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 1vtVOm-00000002wjh-060T; Fri, 20 Feb 2026 18:38:44 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id EC6BB300CDE; Fri, 20 Feb 2026 19:38:40 +0100 (CET) Date: Fri, 20 Feb 2026 19:38:40 +0100 From: Peter Zijlstra To: "Chen, Yu C" Cc: Tim Chen , 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 , 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: <20260220183840.GN1282955@noisy.programming.kicks-ass.net> References: <20260220104533.GO1395266@noisy.programming.kicks-ass.net> <076ee74b-8986-42ad-8aee-ded609afb7fd@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: <076ee74b-8986-42ad-8aee-ded609afb7fd@intel.com> On Sat, Feb 21, 2026 at 12:57:38AM +0800, Chen, Yu C wrote: > llc=llc_id(i) > if(llcllc_max) > safe read sd->pf[llc] Right, except llc_id() is allowed to return negative, so that would need to be something like: if ((unsigned)llc < sd->llc_max) sd->llc_count[llc]