linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [LSF/MM/BPF TOPIC] Predictive readahead of dentries
@ 2025-01-14  3:38 Shyam Prasad N
  2025-01-14 12:39 ` [Lsf-pc] " Jan Kara
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Shyam Prasad N @ 2025-01-14  3:38 UTC (permalink / raw)
  To: lsf-pc, linux-fsdevel, linux-mm, brauner, Matthew Wilcox,
	David Howells, Jeff Layton, Steve French, trondmy
  Cc: Shyam Prasad N

The Linux kernel does buffered reads and writes using the page cache
layer, where the filesystem reads and writes are offloaded to the
VM/MM layer. The VM layer does a predictive readahead of data by
optionally asking the filesystem to read more data asynchronously than
what was requested.

The VFS layer maintains a dentry cache which gets populated during
access of dentries (either during readdir/getdents or during lookup).
This dentries within a directory actually forms the address space for
the directory, which is read sequentially during getdents. For network
filesystems, the dentries are also looked up during revalidate.

During sequential getdents, it makes sense to perform a readahead
similar to file reads. Even for revalidations and dentry lookups,
there can be some heuristics that can be maintained to know if the
lookups within the directory are sequential in nature. With this, the
dentry cache can be pre-populated for a directory, even before the
dentries are accessed, thereby boosting the performance. This could
give even more benefits for network filesystems by avoiding costly
round trips to the server.

NFS client already does a simplistic form of this readahead by
maintaining an address space for the directory inode and storing the
dentry records returned by the server in this space. However, this
dentry access mechanism is so generic that I feel that this can be a
part of the VFS/VM layer, similar to buffered reads of a file. Also,
VFS layer is better equipped to store heuristics about dentry access
patterns.

-- 
Regards,
Shyam


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-01-20 21:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-14  3:38 [LSF/MM/BPF TOPIC] Predictive readahead of dentries Shyam Prasad N
2025-01-14 12:39 ` [Lsf-pc] " Jan Kara
2025-01-15  9:52   ` Shyam Prasad N
2025-01-14 13:24 ` Amir Goldstein
2025-01-14 14:12   ` Benjamin Coddington
2025-01-14 15:01     ` Paulo Alcantara
2025-01-15 14:30       ` Shyam Prasad N
2025-01-15 14:47         ` Paulo Alcantara
2025-01-15 11:27   ` Shyam Prasad N
2025-01-15 14:21     ` Amir Goldstein
2025-01-20 21:26   ` Benjamin Coddington
2025-01-14 15:59 ` James Bottomley
2025-01-16  4:50 ` Al Viro
2025-01-16  5:31 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox