diff options
| author | Jeff Layton <jlayton@redhat.com> | 2012-05-01 17:41:49 -0400 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2012-05-01 23:27:54 -0400 |
| commit | 8f71465c19ffefbfd0da3c1f5dc172b4bce05e93 (patch) | |
| tree | c27bb25b91b148e5977ea29132dc98ccea89f725 | |
| parent | 156d17905e783d057061b3b56a9b3befec064e47 (diff) | |
cifs: don't cap ra_pages at the same level as default_backing_dev_info
While testing, I've found that even when we are able to negotiate a
much larger rsize with the server, on-the-wire reads often end up being
capped at 128k because of ra_pages being capped at that level.
Lifting this restriction gave almost a twofold increase in sequential
read performance on my craptactular KVM test rig with a 1M rsize.
I think this is safe since the actual ra_pages that the VM requests
is run through max_sane_readahead() prior to submitting the I/O. Under
memory pressure we should end up with large readahead requests being
suppressed anyway.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
| -rw-r--r-- | fs/cifs/connect.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f4d381e331ce..6ce888b04dc8 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -3614,22 +3614,6 @@ cifs_get_volume_info(char *mount_data, const char *devname) | |||
| 3614 | return volume_info; | 3614 | return volume_info; |
| 3615 | } | 3615 | } |
| 3616 | 3616 | ||
| 3617 | /* make sure ra_pages is a multiple of rsize */ | ||
| 3618 | static inline unsigned int | ||
| 3619 | cifs_ra_pages(struct cifs_sb_info *cifs_sb) | ||
| 3620 | { | ||
| 3621 | unsigned int reads; | ||
| 3622 | unsigned int rsize_pages = cifs_sb->rsize / PAGE_CACHE_SIZE; | ||
| 3623 | |||
| 3624 | if (rsize_pages >= default_backing_dev_info.ra_pages) | ||
| 3625 | return default_backing_dev_info.ra_pages; | ||
| 3626 | else if (rsize_pages == 0) | ||
| 3627 | return rsize_pages; | ||
| 3628 | |||
| 3629 | reads = default_backing_dev_info.ra_pages / rsize_pages; | ||
| 3630 | return reads * rsize_pages; | ||
| 3631 | } | ||
| 3632 | |||
| 3633 | int | 3617 | int |
| 3634 | cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) | 3618 | cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) |
| 3635 | { | 3619 | { |
| @@ -3717,7 +3701,7 @@ try_mount_again: | |||
| 3717 | cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info); | 3701 | cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info); |
| 3718 | 3702 | ||
| 3719 | /* tune readahead according to rsize */ | 3703 | /* tune readahead according to rsize */ |
| 3720 | cifs_sb->bdi.ra_pages = cifs_ra_pages(cifs_sb); | 3704 | cifs_sb->bdi.ra_pages = cifs_sb->rsize / PAGE_CACHE_SIZE; |
| 3721 | 3705 | ||
| 3722 | remote_path_check: | 3706 | remote_path_check: |
| 3723 | #ifdef CONFIG_CIFS_DFS_UPCALL | 3707 | #ifdef CONFIG_CIFS_DFS_UPCALL |
