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 5EBA038BF87; Mon, 9 Mar 2026 13:44:06 +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=1773063848; cv=none; b=umG/gcPKgPKLqy70jgAU3/uw4fLiW5I1R7VU5WTsaep5wxOgGNWC5tMmpMbnJkLMpZ/kcUbRcxUHsBfnOOMm4hcXP6fp0gc0OdsRNjWhnyz2MGPF1UGPg2k6pQ2PakLLLpRVi00/bd9vezfLPtA/s8ghkVD5+YSPwJ9jxTouYfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773063848; c=relaxed/simple; bh=5kJQogRZBW3Er5b0nNBRNiUdi359L4TCi+FN2N+XQTA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cogPrK9KC7mvUj3MoOEtX4ex9YaWim8LIJh6mAyRHTOqcFNNWdt1Ec/1vC32E7caB3ypOqW+mJYzMreCWa9+pc59OQwjTgoFIcuj+6MC3viLOFs4v1MLV/6PiN4V1U5ej6M1rUXOkQVvd20QQjCn6f8rL29b/KtTbIpdz6D4u8Q= 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=ChsA1u7/; 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="ChsA1u7/" 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=kFLbOMw//S4QUuAdZUf1MLolkl75tvPL0uBSQam12vs=; b=ChsA1u7/t8pUpXioGIjYHkAuPL gR5iXJ9hBUHGmikLiDQOwbq+Q3DfYNx0dhGrutfMG1Nd4K8u+6mCTOPx/QuppTIxv9hSMMCvxKaG2 vz8YBq+ObVoVR6O1vTSKAtv0hRPcz4irv+t1mKdhtWf7msB9jp7HRtWNHiZNXm8apeYrmf/DcYgod wwl23L0qspalSpWJyxyWITPw3STLJ99fijRlbFAVAaSj9GImxYL+vmNXVdOyz94DaKy4SUOwg/kMd St2WTmsOr6BbmjsGLA8eYhtJ27Osu3Jsg4K9i7qDNW9FSBDhx/pR0GjlJJnMNZSrYYrBGfpvGA6p4 rqqRhGtQ==; 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 casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vzatu-00000005bV0-0JfA; Mon, 09 Mar 2026 13:44:02 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id D8B5F300FB6; Mon, 09 Mar 2026 14:43:55 +0100 (CET) Date: Mon, 9 Mar 2026 14:43:55 +0100 From: Peter Zijlstra To: Eric Dumazet Cc: Thomas Gleixner , linux-kernel , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, Sebastian Andrzej Siewior , Marco Elver Subject: Re: [PATCH] locking/local_lock: Reduce local_[un]lock_nested_bh() overhead Message-ID: <20260309134355.GC606826@noisy.programming.kicks-ass.net> References: <20260309122055.1226507-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@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: <20260309122055.1226507-1-edumazet@google.com> On Mon, Mar 09, 2026 at 12:20:55PM +0000, Eric Dumazet wrote: > diff --git a/include/linux/local_lock.h b/include/linux/local_lock.h > index b8830148a8591c17c22e36470fbc13ff5c354955..40c2da54a0b720265be7b6327e0922a49befd8fc 100644 > --- a/include/linux/local_lock.h > +++ b/include/linux/local_lock.h > @@ -94,12 +94,19 @@ DEFINE_LOCK_GUARD_1(local_lock_irqsave, local_lock_t __percpu, > local_unlock_irqrestore(_T->lock, _T->flags), > unsigned long flags) > > +#if defined(WARN_CONTEXT_ANALYSIS) || defined(CONFIG_PREEMPT_RT) || \ > + defined(CONFIG_DEBUG_LOCK_ALLOC) > #define local_lock_nested_bh(_lock) \ > __local_lock_nested_bh(__this_cpu_local_lock(_lock)) > > #define local_unlock_nested_bh(_lock) \ > __local_unlock_nested_bh(__this_cpu_local_lock(_lock)) > > +#else > +static inline void local_lock_nested_bh(local_lock_t *_lock) {} > +static inline void local_unlock_nested_bh(local_lock_t *__lock) {} > +#endif This isn't going to work; WARN_CONTEXT_ANALYSIS is unconditional on clang >= 22.1 How come that this isn't DCEd properly?