diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2022-07-27 13:49:04 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2022-07-30 00:38:16 -0400 |
commit | 50417d22d0efbb1be76c3cb66b2329f83741c9c7 (patch) | |
tree | dd7343e3ad9bd71c6e1e110f369e36e4437f236a /fs/dax.c | |
parent | 45f78b0a2743c4fd71b73400bd5d5339628bf538 (diff) | |
download | linux-50417d22d0efbb1be76c3cb66b2329f83741c9c7.tar.gz linux-50417d22d0efbb1be76c3cb66b2329f83741c9c7.tar.bz2 linux-50417d22d0efbb1be76c3cb66b2329f83741c9c7.zip |
fs/dcache: Move wakeup out of i_seq_dir write held region.
__d_add() and __d_move() wake up waiters on dentry::d_wait from within
the i_seq_dir write held region. This violates the PREEMPT_RT
constraints as the wake up acquires wait_queue_head::lock which is a
"sleeping" spinlock on RT.
There is no requirement to do so. __d_lookup_unhash() has cleared
DCACHE_PAR_LOOKUP and dentry::d_wait and returned the now unreachable wait
queue head pointer to the caller, so the actual wake up can be postponed
until the i_dir_seq write side critical section is left. The only
requirement is that dentry::lock is held across the whole sequence
including the wake up. The previous commit includes an analysis why this
is considered safe.
Move the wake up past end_dir_add() which leaves the i_dir_seq write side
critical section and enables preemption.
For non RT kernels there is no difference because preemption is still
disabled due to dentry::lock being held, but it shortens the time between
wake up and unlocking dentry::lock, which reduces the contention for the
woken up waiter.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dax.c')
0 files changed, 0 insertions, 0 deletions