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 B73604CA761 for ; Thu, 8 Jan 2026 12:44:53 +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=1767876297; cv=none; b=ch+Q1ziF911uWcQDJSDof7zyWjRt0lwaDWdJV+RAtg5NPIUvp0lUdI0R9hjJpKTzEVKBLc2EPqqgDRUNBuKlu3tRtfbabn06O4InNlctnXZUCGntu1EXrMnRUmxlE0EwvHDXrLRiJZgsYrhgIvy4wDSkw4PmkO2wxzLJxPNvGqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767876297; c=relaxed/simple; bh=/R8ENMhoCAudkSl87UwqkV+Z02ocH2brob/dKnv7ilc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l/uNZtwuKmem9Cc7lZH4Q3Wpamu/0E+cMkJfo0U88JRfQfJgBoS4ydFAmaaab28/fmLMGbHWs1azSeZIF7kj/Mmx5yRnax9HAZXUTe6+ghG4BqlB8PqebntOdVlnpbRW8JS6niBrbsU2GKwjId6n8da+wwO7BAGQLytXAVuksPo= 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=KJMrlDv6; 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="KJMrlDv6" 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=EC3Bt8ER3qJtw60XfIVaM6jq4EFAQl6SKorQAnAzNMM=; b=KJMrlDv6Z+Z5czld9Oho/eE2as nNHPo47hNL3Waaij90d/JyI3KFqhMQlOE9FKxhZrLfDhhtLjIWVV25IGFNaXi1Ht917R/v/m9vRPo ySTjK3PReBoNq+sC+urtDsRUFSabrmQbqWGK8kJgTbmXbB8bX1MO9WM0sgP09BPZm+0E2wUhczzs3 jbAuo2B+DyaL9CTEyGxRHj8SyI+zAmu4vflJTYKbf/v6p0uStIK4LDrOpAYLMIeH5n4kKqVNY+9U9 kTrf2y8CGdNr6iKADX5MEHpDY24DXY7/tB176qMqyjywxfTaisxLdj+KFMWVIMi922VH7Zdk60xoF CYHSTLpw==; 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 1vdpNd-0000000EwKo-2YbG; Thu, 08 Jan 2026 12:44:45 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id E7236300E8E; Thu, 08 Jan 2026 13:44:43 +0100 (CET) Date: Thu, 8 Jan 2026 13:44:43 +0100 From: Peter Zijlstra To: Shrikanth Hegde Cc: mingo@kernel.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org, kprateek.nayak@amd.com, juri.lelli@redhat.com, vschneid@redhat.com, tglx@linutronix.de, dietmar.eggemann@arm.com, anna-maria@linutronix.de, frederic@kernel.org, wangyang.guo@intel.com Subject: Re: [PATCH v3 1/3] sched/fair: Move checking for nohz cpus after time check Message-ID: <20260108124443.GA2490257@noisy.programming.kicks-ass.net> References: <20260107065125.669668-1-sshegde@linux.ibm.com> <20260107065125.669668-2-sshegde@linux.ibm.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: <20260107065125.669668-2-sshegde@linux.ibm.com> On Wed, Jan 07, 2026 at 12:21:23PM +0530, Shrikanth Hegde wrote: > NOHZ idle load balancer is kicked off only after time check. So move > the atomic read after the time check to access it only when needed. > > When there are no idle CPUs(100% busy), even if the flag gets set to > NOHZ_STATS_KICK | NOHZ_NEXT_KICK, find_new_ilb will fail and > there will be no NOHZ idle balance. The current behaviour is retained. > > Note: This patch doesn't solve any cacheline overheads. No improvement > in performance apart from saving a few cycles of atomic_read. Note that atomic_read() == READ_ONCE() is just a regular load, but sure.