[PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Another day, another readpages patchset...

This one refines the original one a bit more. The main changes are:

1) this set goes back to adding the pages to the pagecache before
submitting the reads on the wire. The reason for this is that we
want to prevent the VM from reissuing reads for pages that already
have reads in progress.

2) a reference to the cifsFileInfo is held during the I/O. It's
possible that the async reads could outlive a ->release operation
if it were cancelled. To prevent oopses, we need the async read
jobs to hold a cifsFileInfo reference. We can't put cifsFileInfo
references from cifsd however, so we need to queue the completion
of the reads to a workqueue.

3) a patch has been added that limits the bdi.ra_pages according
to the rsize. This ensures that the VM doesn't end up requesting
"straggler" pages that would make cifs_readpages issue small reads
to satisfy.

This patchset uses the infrastructure added in the patchset to overhaul
the receive path to allow cifs to vastly increase the rsize. It also is
more efficient and does less copying as the data is read directly into
the pagecache.

Additionally, readpages is now done asynchronously with this set.
cifs_readpages just puts the pages in the cache, fires off the reads and
returns. Eventually, when the reads complete, a workqueue job is queued
that will mark the pages uptodate and unlock them.

With this set in place, I see a dramatic increase in performance for
buffered read calls. On a simple dd test of a 1GB file to /dev/null:

prepatch, with 16k rsize:
1073741824 bytes (1.1 GB) copied, 47.2119 s, 22.7 MB/s

postpatch, with 1M rsize:
1073741824 bytes (1.1 GB) copied, 11.1602 s, 96.2 MB/s

postpatch, with 60k rsize:
1073741824 bytes (1.1 GB) copied, 12.5183 s, 85.8 MB/s

Other tests show similar results. These results are from my craptacular
KVM-based test rig. I expect that the performance boost will be even
more dramatic on real hardware or on higher-latency connections.

Steve, I'd like to see both of these sets go into 3.2 if at all
possible. Both of these sets should be bisectable, so committing them in
order is highly recommended.

Jeff Layton (5):
  cifs: fix protocol definition for READ_RSP
  cifs: add cifs_async_readv
  cifs: convert cifs_readpages to use async reads
  cifs: allow for larger rsize= options and change defaults
  cifs: tune bdi.ra_pages in accordance with the rsize

 fs/cifs/cifspdu.h   |    4 +-
 fs/cifs/cifsproto.h |   24 ++++
 fs/cifs/cifssmb.c   |  357 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/cifs/connect.c   |  159 ++++++++++++++---------
 fs/cifs/file.c      |  280 ++++++++++++++++------------------------
 5 files changed, 591 insertions(+), 233 deletions(-)

-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux