From: Konstantin Ryabitsev via B4 Web Endpoint <devnull@kernel.org>
To: patches@lists.linux.dev
Subject: [PATCH v1 3/9] dentry: Use preempt_[dis|en]able_nested()
Date: Fri, 19 Aug 2022 14:17:17 -0400 [thread overview]
Message-ID: <20220819-test-endpoint-send-v1-3-2d7c68bdbbdc@linuxfoundation.org> (raw)
In-Reply-To: <20220819-test-endpoint-send-v1-0-2d7c68bdbbdc@linuxfoundation.org>
From: Thomas Gleixner <tglx@linutronix.de>
Replace the open coded CONFIG_PREEMPT_RT conditional
preempt_disable/enable() with the new helper.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
diff --git a/fs/dcache.c b/fs/dcache.c
index c5dc32a59c76..e633b20623d0 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2571,15 +2571,7 @@ EXPORT_SYMBOL(d_rehash);
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 = dir->i_dir_seq;
if (!(n & 1) && cmpxchg(&dir->i_dir_seq, n, n + 1) == n)
@@ -2592,8 +2584,7 @@ static inline void end_dir_add(struct inode *dir, unsigned 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);
}
--
b4 0.10.0-dev-c53d8
next prev parent reply other threads:[~2022-08-19 18:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 18:17 [PATCH v1 0/9] This is a fake series to test web-endpoint-send Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 1/9] slub: Make PREEMPT_RT support less convoluted Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 2/9] preempt: Provide preempt_[dis|en]able_nested() Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` Konstantin Ryabitsev via B4 Web Endpoint [this message]
2022-08-19 18:17 ` [PATCH v1 4/9] mm/vmstat: Use preempt_[dis|en]able_nested() Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 5/9] mm/debug: Provide VM_WARN_ON_IRQS_ENABLED() Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 6/9] mm/memcontrol: Replace the PREEMPT_RT conditionals Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 7/9] mm/compaction: Get rid of RT ifdeffery Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 8/9] u64_stats: Streamline the implementation Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:17 ` [PATCH v1 9/9] u64_stat: Remove the obsolete fetch_irq() variants Konstantin Ryabitsev via B4 Web Endpoint
2022-08-19 18:33 ` [PATCH v1 0/9] This is a fake series to test web-endpoint-send konstantin.ryabitsev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220819-test-endpoint-send-v1-3-2d7c68bdbbdc@linuxfoundation.org \
--to=devnull@kernel.org \
--cc=konstantin@linuxfoundation.org \
--cc=patches@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox