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 B84A127380A for ; Tue, 9 Dec 2025 12:16:56 +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=1765282620; cv=none; b=kGzjV61QQUwch6nzwp5zklvVkZLX2ybFTQ6+kCGHmvQZ0qskKELEgcW8DynPMmvfubxgZiOp9VnnVfD4zsB2mk0h7/HDQoCBpghGHQGcy8q+O05yyJMDp62Svi+eu66HVa8UAVtAnpMeVXz6pZrLK8LIubqluIzVt+GTIgnRSNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765282620; c=relaxed/simple; bh=mzgYVhWHuHWNy0c3M1HqD5QYdzWizAcNgJfMwrk3tK4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OQUuxJ1GCe3T3NOP6C2PAQBcja87MMkqb3sxPm/pDD2H73rnC2pAxj3ESlw/4EAlOd46pFr3m4WsPYvvlw6p3PMsy1soWFyt4C0QKqqJQU4GTlNghYBI0QiSIQpL8Dy5IRWHdLvPKYI4y2h5soaqQUOmc8JfZMbTf3EVegBIc5Y= 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=azFO/SSr; 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="azFO/SSr" 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=sAjSgJtgfwgAheg+hkfA68cG/cKOllpzYUROub4+Jj8=; b=azFO/SSrtzmO3riTXxMnw69qln SHLe/ZHQGLcEum08UptYDOOfjpAEEWBn2HXOho7FmfOrhBcpHt1ptoONukrxXKmkYuGvlRiQybLZD HUXWG1Tto1Iw09na3wo/WbpkpMI88ZnDvKmUP7oivXSQ4pAAzUhU+bDlNwECUBQQJnRsxqDOZ5TeW gw4lWuX0zQa+MNDw1J0wGMmwEG9aiU0M/CtmWdvR1ke3nVUPuFUlfFHF+plCvcU1742wCbZLs+ZUr JX9l7MBRZM8o0bNvzT+rsg2VAE1rGb1sM/rNIL8y90epHwAh1gBOb7Ze4vq8kbSYbZTjZGPA0q07J ayyAnGwA==; 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 1vSvm8-0000000Bisp-29o8; Tue, 09 Dec 2025 11:21:04 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 760AB30045C; Tue, 09 Dec 2025 13:16:17 +0100 (CET) Date: Tue, 9 Dec 2025 13:16:17 +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 06/23] sched/cache: Track LLC-preferred tasks per runqueue Message-ID: <20251209121617.GN3707891@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 Wed, Dec 03, 2025 at 03:07:25PM -0800, Tim Chen wrote: > #ifdef CONFIG_SCHED_CACHE > struct callback_head cache_work; > + /*the p is currently refcounted in a rq's preferred llc stats*/ Shall we have spaces after and before the comment marks? Also, comment confuses me, I don't see get_task_struct() / put_task_struct() usage. Did you mean something else with refcount? > + bool sched_llc_active; > int preferred_llc; > #endif > +static void account_llc_dequeue(struct rq *rq, struct task_struct *p) > +{ > + int pref_llc; > + > + /* > + * Borrow the uc_se->active from uclamp_rq_inc_id(), > + * uclamp_rq_dec_id() to avoid the unbalanced calculation > + * of rq statistics. > + */ > + if (unlikely(!p->sched_llc_active)) > + return; Another very confusing comment; what? Also, can you please explain (in the new comment) how we get here without having llc_active set? > + > + pref_llc = p->preferred_llc; > + if (pref_llc < 0) > + return; > + > + rq->nr_llc_running--; > + rq->nr_pref_llc_running -= (pref_llc == task_llc(p)); > + p->sched_llc_active = false; > +}