From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 5B7A2625; Tue, 25 Aug 2026 23:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787701687; cv=none; b=YhVr+jTs4UnOuPyHon+AzEV8Cj9oYaVSwxhCqmAbEeTf7vyz0WFIFPU39l3P0FpilYOoNQfnMfWJ3rXS7cpmflvsiXPjCGzT3YIx8TMPzIptrl1o48fzEC9aDyQXtjd3ykcR6Md+GmeITaT+Ox04BcTZDr7WKgAeLw+O/EmKTjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787701687; c=relaxed/simple; bh=awaqtrn2M9RE4ZiXm1R1daa3s/Ww75AQb3QBclodc1o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QZLYhBlNox2hRR8CRy5GyaitlL3lrDibf5/ACY2ry/Chykd1s/zE/EipY+UaZxEIB6b1dNhdoho/mWR0TsyDVFqyElb+vfzsA8UfrcMwQZq4t/LrWcGj8As4DaDTf29S46JeDgvYfHasQKWYaYMT0Pi3gHL8veV5Izbp8l8D0hY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bSk6kdxE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bSk6kdxE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7F7D1F00A3A; Tue, 25 Aug 2026 23:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787701686; bh=jX6OonoHCW82CuvgJZalgMUnr885mIUCZpRjTg/OVys=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=bSk6kdxE9ngCHZtQs/kthv6X2uLtdJw+Tf4iUQoCZFIRypYg3bYNFCuZUyqp1bQNB Il5eIA2PeKqPRP4LmbalBg7fqA4eMcZdK4rfwHrwW85lqjPYFs+bZ7rsdoxrwAwXcV iJS/JG6g8VTh/syeaBVLMIdlZSHiX5CDDXwXWZfSjZ5iYyiOgmXoaOWNxis6pqDjqm 3n0vtyTFdMuuSA84TpGA4xWkCRUUiT/hXLyOTyar8naNfYRqZeeCmHva6U4PSxJwSl 4BxHfIRy73h+kOW6eaUeonnwH21JaRPOJMyj33c065uJIC2YU8C+PXUy1wkaALjNuE J0qzaFGLM6Wlw== Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfauth.phl.internal (Postfix) with ESMTP id EF783F40067; Tue, 25 Aug 2026 19:48:04 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 25 Aug 2026 19:48:04 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFJokbK7RrLFLIT609mz7vs0XZLvRUgSezCU0+1pGV/jfXYfB7ocoIbUVDYlCjATb Nmrcl+v2UaAM7zyDTspCOI8zVNsetD39Xv2mms0LNAliOaXkwmoWFy/QYTvKqFdbmMIo8M 1212m+93w/ixBiL4kv5PWF2MQnwPSoV2dDu+rEYEOd8xrpXuanp34uumeG/LMxC9jVGLCk ko/K0rxYmptFpEgSK74KqNwOvIE7X9vL4x7VYFXafjuy4i/d6jZzOhFV1RXaGjdfqX14rh 9eGW9EDybU9cO+4Fr+xvbNaN3YIFUU2Pe+doWoYSfh10gwiCCNhOG1My6L/CMlDcEvfXJC F4MmOC33VjlOJhoRIda13rhOb/tJngH2AH68TTpjv+yRipk2vPMuW0r7PfU6sQ3ABJ4R75 p82k77xANYyqUXdSaW9YYlFYqa8N2ywCoZjE/QIoYazUIYMSmq97KEizuQgkgYpJ2K805M p4c7p4XjomnD5CzWLbtWYTQSiUex5XfpDnU8NV5fCnbfxTc0CtLSo+/08RFsTw9l8njvYo bTXOU2v/0IlueZdGg4CHs82XAUanCs6u5J/qAZCJ0DCtmMEKaKpVJ8EJR92LKwOmBPCaZ+ FTXrq1PDAR1aNS/7wSJw0bzYjMgBiUR2xAWtEipeNRY56BMpGiNsVNRNLNMg X-ME-Proxy: Feedback-ID: i8dbe485b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Aug 2026 19:48:04 -0400 (EDT) Date: Tue, 25 Aug 2026 16:48:03 -0700 From: Boqun Feng To: Thomas Gleixner Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] locking: Revert switching guards to _irq_{disable,enable}() Message-ID: References: <20260804161447.84806-8-boqun@kernel.org> <178635226387.442315.3868294476114711805.tip-bot2@tip-bot2> <20260824104704.GA4121339@noisy.programming.kicks-ass.net> <20260824105523.GA4121620@noisy.programming.kicks-ass.net> <877bldhkmq.ffs@fw13> 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 Tue, Aug 25, 2026 at 04:28:59PM -0700, Boqun Feng wrote: > On Wed, Aug 26, 2026 at 12:59:25AM +0200, Thomas Gleixner wrote: > > On Mon, Aug 24 2026 at 18:33, Boqun Feng wrote: > > > On Mon, Aug 24, 2026 at 12:55:23PM +0200, Peter Zijlstra wrote: > > >> > > >> While the guards are properly nested, not all wrapped code is nice, as already > > >> highlighted by that fair.c hunk. > > >> > > >> Syzbot found another instance of this pattern in posix_timer_delete(), which > > >> does spin_unlock_irq()+spin_lock_irq() inside scoped_guard(spinlock_irq). > > >> Combined with this patch, that goes sideways most spectacular. > > >> I'm not saying the posix_timer_delete() implementation has any problem, but TBH allowing spin_unlock_irq()+spin_lock_irq() inside scoped_guard(spinlock_irq) is questionable design, and can result into foot-gun code like: scoped_guard(spinlock_irq) { ... spin_unlock_irq(); if (cond) return; // BOOM, double unlock spin_lock_irq(); } Sure, if handling carefully, it won't cause problem, but it undermines the easy-to-use and less-err-prone features of scoped_guard(). Regards, Boqun > > >> Undo this change, until we've developed stronger tools / debug for such issues. > > >> > > > > > > Mainly hand-waving, but if we make _irq(), irqsave(), _disable() > > > __acquires() different contexts, we may be able to catch these issues at > > > compile time. I will explore a bit on this. [...]