Skip to contentSkip to conversation

Make NFS-Client readahead tunable

RFC Martin Knoblauch 4 participants 4 messages Sep 18, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

----- Original Message ----

Quoted 35 lines

From: Andrew Morton <[email protected]>
To: Martin Knoblauch <[email protected]>
Cc: Greg Banks <gnb-cP1dWloDopni96+mSzHFpQC/[email protected]>; linux-nfs list <[email protected]>; [email protected]
Sent: Thursday, September 18, 2008 10:18:18 AM
Subject: Re: [RFC][Resend] Make NFS-Client readahead tunable

Quoted 5 lines · On Thu, 18 Sep 2008 00:42:58 -0700 (PDT) Martin Knoblauch wrote:

----- Original Message ----

Quoted 3 lines

From: Andrew Morton
To: Greg Banks
Cc: Martin Knoblauch ; linux-nfs list

; [email protected]

Quoted 20 lines
Quoted 5 lines

Sent: Thursday, September 18, 2008 5:13:34 AM
Subject: Re: [RFC][Resend] Make NFS-Client readahead tunable

On Thu, 18 Sep 2008 11:42:54 +1000 Greg Banks wrote:

Quoted 8 lines
Quoted 6 lines

I think having a tunable for client readahead is an excellent idea, although not to solve your particular problem. The SLES10 kernel has a patch which does precisely that, perhaps Neil could post it.

I don't think there's a lot of point having both a module parameter and a sysctl.

mount -o remount,readahead=42

[root@lpsdm52 ~]# mount -o remount,readahead=42 /net/spsdms/fs13 Bad nfs mount parameter: readahead
[root@lpsdm52 ~]# mount -o readahead=42 /net/spsdms/fs13 Bad nfs mount parameter: readahead

Quoted 5 lines
Quoted 1 line

I assume the reply was meant to say that the correct way of introducing a

modifyable readahead size is to implement it as a mount option ? :-)

Yes.

:-)

Quoted 6 lines
Quoted 1 line

I considered it, but it seems to be more intrusive than the workaround patch.

It also needs changes to userspace tools - correct?

No. mount(8) will pass unrecognised options straight down into the filesystem driver.

Has that always been the case, or is it a recent change? I have to support RHEL4 userland, which is not really new.

Quoted 3 lines

It's better this way - it allows the tunable to be set on a per-mount basis rather than machine-wide.

No question about that. I just thought it to be to complicated. Maybe I erred.

Quoted 8 lines

Note that for block devices, readahead is a per-backing_dev_info thing (and a backing_dev_info has a 1:1 relationship to a disk drive for sane setups).

And the NFS client maintains a backing_dev_info, which appears to map onto a server, so making the NFS readahead a per-backing_dev_info (ie:
per server) thing might make sense. Maybe nfs makes per-server information manipulatable down in sysfs somewhere..

I believe Peter wanted to add per bdi stuff for nfs some time ago. Not sure what came out of it.

Cheers
Martin

#1 lore raw
Quoted 5 lines · On Thu, 18 Sep 2008 01:38:57 -0700 (PDT) Martin Knoblauch…
Quoted 3 lines

No. mount(8) will pass unrecognised options straight down into the filesystem driver.

Has that always been the case, or is it a recent change? I have to support RHEL4 userland, which is not really new.

It's been that way for ever and ever. It's how all these guys:

y:/usr/src/25> grep Opt_ fs/*/super.c|wc

    781    2626   33703

get handled.

#2 lore raw
Quoted 10 lines · Andrew Morton
Quoted 6 lines · On Thu, 18 Sep 2008 01:38:57 -0700 (PDT) Martin Knoblauch <[email protected]>…
Quoted 4 lines

No. mount(8) will pass unrecognised options straight down into the filesystem driver.

Has that always been the case, or is it a recent change? I have to support RHEL4 userland, which is not really new.

Quoted 7 lines

It's been that way for ever and ever. It's how all these guys:

y:/usr/src/25> grep Opt_ fs/*/super.c|wc

    781    2626   33703

get handled.

NFS was...special...for a long time.

Signature · 3 lines
Greg Banks, P.Engineer, SGI Australian Software Group.
Be like the squirrel.
I don't speak for SGI.
#3 lore raw
In reply to Martin Knoblauch
Quoted 1 line · Martin Knoblauch

I believe Peter wanted to add per bdi stuff for nfs some time ago. Not sure what came out of it.

$ mount localhost:/ /mnt/tmp
$ grep nfs /proc/$$/mountinfo
21 17 0:17 / /var/lib/nfs/rpc_pipefs rw - rpc_pipefs rpc_pipefs rw
31 13 0:20 / /proc/fs/nfsd rw - nfsd nfsd rw
37 17 0:22 / /mnt/tmp rw - nfs localhost:/ rw,vers=3,rsize=65536,wsize=65536,namlen=255,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=127.0.0.1,mountvers=3,mountproto=tcp,addr=127.0.0.1
$ ls -la /sys/class/bdi/0\:22/
total 0
drwxr-xr-x  3 root root    0 2008-09-18 15:16 .
drwxr-xr-x 21 root root    0 2008-09-18 15:16 ..
-rw-r--r--  1 root root 4096 2008-09-18 15:19 max_ratio
-rw-r--r--  1 root root 4096 2008-09-18 15:19 min_ratio
drwxr-xr-x  2 root root    0 2008-09-18 15:19 power
-rw-r--r--  1 root root 4096 2008-09-18 15:19 read_ahead_kb
lrwxrwxrwx  1 root root    0 2008-09-18 15:19 subsystem -> ../../bdi
-rw-r--r--  1 root root 4096 2008-09-18 15:19 uevent
$ cat /sys/class/bdi/0\:22/read_ahead_kb
960