[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Negative dentries, 20 years later

Negative dentries, 20 years later

Posted Apr 11, 2022 22:13 UTC (Mon) by willy (subscriber, #9762)
In reply to: Negative dentries, 20 years later by cesarb
Parent article: Negative dentries, 20 years later

By all means try to implement this, but I think it'll be vastly inferior to the current dcache.

Lookup is currently hash(directory pointer, component) and search the global hash table. What you're proposing would be a per-directory data structure to search, so a massive change.

Also, you'd need to be able to query the filesystem for the "previous" and "next" entries ... for whatever sort you think needs to be used (filesystem directories are not necessarily sorted in any way you think they are).


to post comments

Negative dentries, 20 years later

Posted Apr 11, 2022 23:30 UTC (Mon) by cesarb (subscriber, #6266) [Link]

> By all means try to implement this, but I think it'll be vastly inferior to the current dcache.

I don't doubt that it would be inferior; still, it's an interesting thought experiment.

> Lookup is currently hash(directory pointer, component) and search the global hash table. What you're proposing would be a per-directory data structure to search, so a massive change.

Actually, it could be a per-filesystem data structure, if the concept of range is extended to include the parent directory; but it would have to be something like hash(directory pointer) || key(component), with the definition of key() depending on the filesystem's native on-disk order (if it has one; naïve filesystems with simple unsorted directories could use hash(component) for the key). I agree that it would be a massive change, with potential gains only on an unlikely case (a large amount of lookups to non-existing entries, which could be hits on a negative range cache but would be misses on a negative entry cache).

> Also, you'd need to be able to query the filesystem for the "previous" and "next" entries ... for whatever sort you think needs to be used (filesystem directories are not necessarily sorted in any way you think they are).

Yes, the sort would have to be filesystem-specific; I went into more detail on another comment above.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds