Re: [PATCH v11 00/20] nfs/nfsd: add support for localio

Christoph Hellwig
2024-07-03T15:18:03Z

On Wed, Jul 03, 2024 at 11:11:51AM -0400, Mike Snitzer wrote:
> Will welcome any help you might offer to optimize localio as much as
> possible (doesn't need to be in near-term, whenever you might have
> time to look). Its current approach to use synchronous buffered
> read_iter and write_iter, with active waiting, should be improved.
>
> But Dave's idea to go full RMW to be page aligned will complicate a
> forecasted NFS roadmap item to allow for: "do-not-cache capabilities,
> so that the NFS server can turn off the buffer caching of files on
> clients (force O_DIRECT-like writing/reading)". But even that seems a
> catch-22 given the NFS client doesn't enforce DIO alignment.

As I just wrote in another mail I've now looked at the architecture,
and either I'm missing some unstated requires, or the whole architecture
seems very overcomplicated and suboptimal. If localio actually just was
a pNFS layout type you could trivially do asynchronous direct I/O from
the layout driver, and bypass a lot of the complexity. The actual way
to find the file struct still would be nasty, but I'll try to think of
something good for that.