mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-01 05:37:33 +00:00
f9e282048f60a191fdcaf0dcee9474d038c12b7b
Initially we had d_revalidate always return that the dentry was invalid. This avoids dentry cache consistency problems across the cluster by always performing lookups. That's slow by itself, but it turns out that the dentry invalidation that happens on revalidation failure is very expensive if you have lots of dentries. So we switched to forcefully dropping dirents as we revoked their lock. That avoided the cost of revalidation failure but it adds the problem that dentries are unhashed when their locks are dropped. This causes paths like getcwd() to return errors when they see unhashed dentries instead of trying to revalidate them. This implements a d_revalidate which actually does work to determine if the dentry is still valid. When we populate dentries under a lock we add them to a list on the lock. As we drop the lock we remove them from the list. But the dentry is not modified. This lets paths like getcwd() still work. Then we implement revalidation that does the actual item lookups if the dentry's lock has been dropped. This lets revalidation return success and avoid the terrible invalidation costs from returning failure and then calling lookup to populate a new dentry. This brings us more in line with the revalidation behaviour of other systems that maintain multi-node dcache consistency. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
7.7 MiB
Languages
C
86.4%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.3%