NFS: Optimise the default readahead size
authorTrond Myklebust <trondmy@gmail.com>
Sun, 22 Sep 2019 19:07:49 +0000 (15:07 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 24 Sep 2019 19:58:20 +0000 (15:58 -0400)
commitc128e575514ce93dced349417d136304a33b6f99
treede3b205b0a419093b51f9e5184dcad567da0d84f
parent32c6e7eee39999084448b15e96a0e3c7d2f9021e
NFS: Optimise the default readahead size

In the years since the max readahead size was fixed in NFS, a number of
things have happened:
- Users can now set the value directly using /sys/class/bdi
- NFS max supported block sizes have increased by several orders of
  magnitude from 64K to 1MB.
- Disk access latencies are orders of magnitude faster due to SSD + NVME.

In particular note that if the server is advertising 1MB as the optimal
read size, as that will set the readahead size to 15MB.
Let's therefore adjust down, and try to default to VM_READAHEAD_PAGES.
However let's inform the VM about our preferred block size so that it
can choose to round up in cases where that makes sense.

Reported-by: Alkis Georgopoulos <alkisg@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/internal.h
fs/nfs/super.c