From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11403ECAA25 for ; Thu, 25 Aug 2022 16:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242810AbiHYQm0 (ORCPT ); Thu, 25 Aug 2022 12:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243139AbiHYQmC (ORCPT ); Thu, 25 Aug 2022 12:42:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 263F7BA161; Thu, 25 Aug 2022 09:41:54 -0700 (PDT) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1661445700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1SZrqW9HXmPmjeRTWLOFIPzv0CDV88cfUXj8V+IhumA=; b=3aoPzsiddfr47zJqtlRQLXYAwPLIHSoLxMe/Nk47fEMwS6kj/gcI5cwRJs5BEuqm/bw9JU A7czQVdmEdkZ6JDGlC15B2mcrLEajs6svacjOk/5eYV/l9nHsCVBnlP4Y08VEAk5u7uqoH 8remR50kIC3O2l2rsHcpmtRNmM4wvQCz7KcSDXgpoIh+twXN65DR1PKMyPPpOKIolxaNxv mSMIBOmntF1TNdDLCxtdMPV98hVyX73aPqQwqEwZKRvjZD2lTvmMW/dB+IwPZm6nI9XllU yb1XydP2ZE+b5iizS7M3SipG30DcqJ6oIc12WiKG1WCRqMLjGSUn6pKps2M4xA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1661445700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1SZrqW9HXmPmjeRTWLOFIPzv0CDV88cfUXj8V+IhumA=; b=yPSOGceGxVZ8dRB1hmldox0oTV9Bh5mC4tmfz4S4xReQF2fiuNDuW0qS/tLYNsYe8XCapI VNGfxPWh9Ejs0dDQ== To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Peter Zijlstra , Steven Rostedt , Linus Torvalds , Matthew Wilcox , Alexander Viro , linux-fsdevel@vger.kernel.org, Sebastian Andrzej Siewior Subject: [PATCH v2 2/8] dentry: Use preempt_[dis|en]able_nested() Date: Thu, 25 Aug 2022 18:41:25 +0200 Message-Id: <20220825164131.402717-3-bigeasy@linutronix.de> In-Reply-To: <20220825164131.402717-1-bigeasy@linutronix.de> References: <20220825164131.402717-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner Replace the open coded CONFIG_PREEMPT_RT conditional preempt_disable/enable() with the new helper. Signed-off-by: Thomas Gleixner Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) --- fs/dcache.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index bb0c4d0038dbd..2ee8636016ee9 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2597,15 +2597,7 @@ EXPORT_SYMBOL(d_rehash); =20 static inline unsigned start_dir_add(struct inode *dir) { - /* - * The caller holds a spinlock (dentry::d_lock). On !PREEMPT_RT - * kernels spin_lock() implicitly disables preemption, but not on - * PREEMPT_RT. So for RT it has to be done explicitly to protect - * the sequence count write side critical section against a reader - * or another writer preempting, which would result in a live lock. - */ - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_disable(); + preempt_disable_nested(); for (;;) { unsigned n =3D dir->i_dir_seq; if (!(n & 1) && cmpxchg(&dir->i_dir_seq, n, n + 1) =3D=3D n) @@ -2618,8 +2610,7 @@ static inline void end_dir_add(struct inode *dir, uns= igned int n, wait_queue_head_t *d_wait) { smp_store_release(&dir->i_dir_seq, n + 2); - if (IS_ENABLED(CONFIG_PREEMPT_RT)) - preempt_enable(); + preempt_enable_nested(); wake_up_all(d_wait); } =20 --=20 2.37.2