Commit 50417d2
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>1 parent 45f78b0 commit 50417d2
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2581 | 2581 | | |
2582 | 2582 | | |
2583 | 2583 | | |
2584 | | - | |
| 2584 | + | |
| 2585 | + | |
2585 | 2586 | | |
2586 | 2587 | | |
2587 | 2588 | | |
2588 | 2589 | | |
| 2590 | + | |
2589 | 2591 | | |
2590 | 2592 | | |
2591 | 2593 | | |
| |||
2756 | 2758 | | |
2757 | 2759 | | |
2758 | 2760 | | |
2759 | | - | |
2760 | 2761 | | |
2761 | 2762 | | |
2762 | 2763 | | |
| |||
2768 | 2769 | | |
2769 | 2770 | | |
2770 | 2771 | | |
2771 | | - | |
| 2772 | + | |
2772 | 2773 | | |
2773 | 2774 | | |
2774 | 2775 | | |
| |||
2947 | 2948 | | |
2948 | 2949 | | |
2949 | 2950 | | |
2950 | | - | |
2951 | 2951 | | |
2952 | 2952 | | |
2953 | 2953 | | |
| |||
2983 | 2983 | | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | | - | |
| 2986 | + | |
2987 | 2987 | | |
2988 | 2988 | | |
2989 | 2989 | | |
| |||
0 commit comments