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 DB3F81D5174 for ; Thu, 12 Mar 2026 09:46:15 +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=1773308778; cv=none; b=Ck7rt+k4ZuwJsCsuALBMVm5byGek4+84btLAKg7kCiRjoZWEMoq5kchXQc24g21x82insITyNr0dyvD5EtCfP+mvk+yxf59D5mzu3aUND9iMM3/TX2vrzQpwZPxkkowQzoLu/L6Ud+1ppPR1zTi8T7lfqJymQlxVdDK2oT+Z2MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773308778; c=relaxed/simple; bh=am6aQg7OofOOugdiH+Zof5744P//rM+KeeltkWcJdEs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bGELnX7v8/QQWSuxmzxruifrm+9QGPDAfSQ15jT1qJjJ+UsUx2VFMeenM68XmVo3qPffwLBMmK7nMCjMTM9DzCvIZ/BoGwJcVEKM2QJmfCZ9vHroaulNklUFZVG4YwZ9BwUjFwy2/wHOSdlger49pfeVeDKc95il069cJRju6E0= 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=U6DjPBwn; 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="U6DjPBwn" 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=7oDGoODAASgz0CWRrszfOtc+7+p7JsUj3+e6FBf55m4=; b=U6DjPBwnTyyqrWpzyx1IPKwTuy EXbiOWsCJZZnPC6bNCezDvQ1cADKOc8Mx9DmlIfehj6wv2iv4ljXDt+lX2tltmwWpmcEv4s/rn3Th hKI0rk0FvDZoAljHEHYKDo/S2ZYZTgOwXYqoPuxc4VZzz5pJGDsbVx9w5z4WBEppTR9zufH4xuEhr 659M+zfDtmfyxz9LAp89tgOhqLRE6pR71+8Mi7fu8vspScivUR1itwnsRi8VZPuxB22LYxs9GA9tS Wk2dJHuj40asQq6/YhCgSB4MDa0h3NsbkZsxp828/CaY9lLwN86odeXS/9e+3XPgZzwUzd2hXm1Vp 85GtqNTQ==; 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 1w0ccI-00000000rWq-12cI; Thu, 12 Mar 2026 09:46:06 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 9A2BC301150; Thu, 12 Mar 2026 10:46:05 +0100 (CET) Date: Thu, 12 Mar 2026 10:46:05 +0100 From: Peter Zijlstra To: K Prateek Nayak Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Valentin Schneider , linux-kernel@vger.kernel.org, Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Chen Yu , Shrikanth Hegde , Li Chen , "Gautham R. Shenoy" Subject: Re: [PATCH v4 6/9] sched/core: Check for rcu_read_lock_any_held() in idle_get_state() Message-ID: <20260312094605.GY1282955@noisy.programming.kicks-ass.net> References: <20260312044434.1974-1-kprateek.nayak@amd.com> <20260312044434.1974-7-kprateek.nayak@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: <20260312044434.1974-7-kprateek.nayak@amd.com> On Thu, Mar 12, 2026 at 04:44:31AM +0000, K Prateek Nayak wrote: > Similar to commit 71fedc41c23b ("sched/fair: Switch to > rcu_dereference_all()"), switch to checking for rcu_read_lock_any_held() > in idle_get_state() to allow removing superfluous rcu_read_lock() > regions in the fair task's wakeup path where the pi_lock is held and > IRQs are disabled. > > Signed-off-by: K Prateek Nayak > --- > Changelog v3..v4: > > o No changes. > --- > kernel/sched/sched.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 953d89d71804..c4fc7726f82a 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -2853,7 +2853,7 @@ static inline void idle_set_state(struct rq *rq, > > static inline struct cpuidle_state *idle_get_state(struct rq *rq) > { > - WARN_ON_ONCE(!rcu_read_lock_held()); > + WARN_ON_ONCE(!rcu_read_lock_any_held()); Should we perhaps make that: lockdep_assert(rcu_read_lock_any_held()); ?