Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5026263rwb; Wed, 17 Aug 2022 09:45:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7LFm7Gn0Nu77jR/+lR4XRaUI05gYW2A/30lPU3aOHouCuGsVJ16cWXiGSF6NiLnf1bOHV0 X-Received: by 2002:a05:6402:26c5:b0:43e:2f1b:31c2 with SMTP id x5-20020a05640226c500b0043e2f1b31c2mr23575138edd.424.1660754728559; Wed, 17 Aug 2022 09:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660754728; cv=none; d=google.com; s=arc-20160816; b=Xo21uitWpcLYBaVc1TX7/VEEDEHwN/yOZsMgfNc/VbPYSPw5eYDmT+Cxx5aWnkYx/y XRs5GxEdQzAHwf5eGes8yhDwyf9gFCfqjEqBOJNcouTSaq/bUoXQEPptUftHv5S85UqZ gd5Ig5y/C7x3vbYU08UbPaO0NFm1+r2xLjfRU+DMYyAHBy6FDNY964C7xgw3Uu0330Nx hz6wY/X7FFC4sHC4voaoBCtdoEAhHRAQp7S8W40bSpKVIm94E1EvnEs2E7/ag0wYmKPC Iy21bt7SJPptjUbFUYbREo18/Cvnk0yNrCiW/2S6XZHaA2/aHNUyA8sHpw/Qp65qUnhG QDJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=u0Ok6MUAk8x3w8mPmM/6Qoan0Ip4Uzec0QyzMU/ssm0=; b=g+NH0D8+MvUqObQUdkJ6FyqeWNeR8gMcKlAA0s0TeGl6cMpisL77cfuDUtdfSUVmtE WWswavNLT3eU5IGXO/gTg+sQ4YUbip1ZU+vwv2kkKNCqtpiRq6y4qtTpnmxGGT1aY0rg HeZqQrV4mrB6AR1hId0HRnG8aO73/uF7UwXFI7hOMAsvumh+e+F8ZQQTP/C9eO7/L2PY 8r7J7Uf8zMKrVwtkB35c7SblrC/cgkioKD6VJfXcVh87X5SGPetP4ZQNi/mIkRDM9vEN L3bKNWvBfjUdAFMX5EBRF44apbVi5LxQL4TauKHjq5mOmwqpCsmNxod53Htgw142aPO7 mwCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="R9L/lild"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TFIefRo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dv13-20020a170906b80d00b006feba25b350si10912039ejb.106.2022.08.17.09.45.02; Wed, 17 Aug 2022 09:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="R9L/lild"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TFIefRo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241089AbiHQQ1x (ORCPT + 99 others); Wed, 17 Aug 2022 12:27:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240992AbiHQQ1k (ORCPT ); Wed, 17 Aug 2022 12:27:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90366A026D; Wed, 17 Aug 2022 09:27:38 -0700 (PDT) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1660753656; 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=u0Ok6MUAk8x3w8mPmM/6Qoan0Ip4Uzec0QyzMU/ssm0=; b=R9L/lild30rdOVsQc6pLpf3scnK6BTt6SxBcaGCg103/2NyevPy7UhkQWpNkeTFph/5n6p 5DLaTNT8/q8nhhqaqlc4+/VAZAi5hos4h4H214aL2Ug+lzm7UUWEyhATRLpPoFSDAw1lfG eXJISnCWkZYoDag28Ubv+oRd6Vj68u7r5fPS84bAySnR3MQf16TpQ1411jCEwT2lKstoDh GIiA/vCl6WMat5bmP16QKxByD9zdl7QP/AeXIq3f/L6cuhoGvzY/ArEZHd69sas1TINAjj mPWk+IX0Cd6IVQCyjD+Z7hluH0hNmYfpxvIvx6WaLwH6Q2jXj9xpJVje6Ru2QA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1660753656; 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=u0Ok6MUAk8x3w8mPmM/6Qoan0Ip4Uzec0QyzMU/ssm0=; b=TFIefRo56E8S2+NDTHAb/IgOFgHMaOeEPY0cPRNmU9q0IJdS03M6Fr8tg6vagcUmQqUdXw zLwNRJApEbVTx7Ag== 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 3/9] dentry: Use preempt_[dis|en]able_nested() Date: Wed, 17 Aug 2022 18:26:57 +0200 Message-Id: <20220817162703.728679-4-bigeasy@linutronix.de> In-Reply-To: <20220817162703.728679-1-bigeasy@linutronix.de> References: <20220817162703.728679-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- fs/dcache.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index c5dc32a59c769..e633b20623d0f 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2571,15 +2571,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) @@ -2592,8 +2584,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