cifs: set ra_pages in backing_dev_info
commit591c80b5a9a9331a9b2a6d1b7d9b97d3445107c9
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Mar 2011 20:25:57 +0000 (25 16:25 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Apr 2011 21:32:20 +0000 (21 14:32 -0700)
treead013ed7abb0b7eadb9e456a90a95c0bccbdf41a
parent7cb41edf395b70a6e48162382c5577967ce92bbf
cifs: set ra_pages in backing_dev_info

commit 2b6c26a0a62cc0bab0ad487533d5581d7c293fef upstream.

Commit 522440ed made cifs set backing_dev_info on the mapping attached
to new inodes. This change caused a fairly significant read performance
regression, as cifs started doing page-sized reads exclusively.

By virtue of the fact that they're allocated as part of cifs_sb_info by
kzalloc, the ra_pages on cifs BDIs get set to 0, which prevents any
readahead. This forces the normal read codepaths to use readpage instead
of readpages causing a four-fold increase in the number of read calls
with the default rsize.

Fix it by setting ra_pages in the BDI to the same value as that in the
default_backing_dev_info.

Fixes https://bugzilla.kernel.org/show_bug.cgi?id=31662

Reported-and-Tested-by: Till <till2.schaefer@uni-dortmund.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifsfs.c