diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2026-04-11 11:01:28 +0300 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2026-06-05 07:34:55 +0300 |
| commit | a5beeb64f22662a53facd71ca2843f9d649597d6 (patch) | |
| tree | c00a9091d45f3f9248fe019cda9c104f75fef041 /scripts/Makefile.thinlto | |
| parent | b4143e0e71cd660d05de8d2861e980e7c840eb39 (diff) | |
| download | linux-a5beeb64f22662a53facd71ca2843f9d649597d6.tar.xz | |
Document rcu_read_lock() use in select_collect2()
If select_collect2() finds something that is neither busy nor can
be moved to shrink list, it needs to return that to caller's caller
(shrink_dcache_tree()) ASAP and do so without grabbing references (among
other things, it might be already dying, in which case refcount can't be
incremented). We are called inside a ->d_lock scope, but that scope is
going to be terminated as soon as we return to caller (d_walk()); ->d_lock
will be retaken by shrink_dcache_tree(), but we need to bridge between
these scopes, turning them into contiguous RCU read-side critical area.
We do that with rcu_read_lock() scope - it spans from unbalanced
rcu_read_lock() in select_collect2() to unbalanced rcu_read_unlock()
in shrink_dcache_tree(). That works, but it really needs to be documented;
it's rather unidiomatic and it had caused quite a bit of confusion - some
of it in form of patches "fixing" the damn thing.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
