On Fri, Feb 17, 2023 at 09:08:27AM -0500, David Wysochanski wrote: > On Fri, Feb 17, 2023 at 6:56 AM Daire Byrne <daire@xxxxxxxx> wrote: > > On newer kernels, it looks like the task io accounting is not > > incrementing the read_bytes when reading from a NFS mount? This was > > definitely working on v5.16 downwards, but has not been working since > > v5.18 up to v6.2 (I haven't tested v5.17 yet). > > In v5.16 we had this call to task_io_account_read(PAGE_SIZE); on line 109 > of read_cache_pages(); > > But there's no call to task_io_account_read() anymore in the new > readahead code paths that I could tell, > but maybe I'm missing something. > > Willy, > Does each caller of readahead_page() now need to call > task_io_account_read() or should we add that into > readahead_page() or maybe inside read_pages()? I think the best way is to mimic what the block layer does as closely as possible. Unless we can pull it out of the block layer & all filesystems and put it in the VFS (which we can't; the VFS doesn't know which blocks are recorded by the filesystem as holes and will not result in I/O). The block layer does it as part of the BIO submission path (and also counts PGPGIN and PGPGOUT, which no network filesystems seem to do?) You're more familiar with the NFS code than I am, so you probably have a better idea than __nfs_pageio_add_request().