All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #6)
@ 2011-10-11 12:35 Jeff Layton
       [not found] ` <1318336527-13648-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-10-11 12:35 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Just some small changes since the last patchset to fix problems noticed
by Pavel Shilovsky:

- the max rsize when posix extensions are not in force was too large
  by 1 byte

- some of the debug printks in cifs_readv_receive were using the wrong
  width specifier for size_t and ssize_t (%lu instead of %zu)

This patchset uses the infrastructure added in the receive path overhaul
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.

This set and the preceding overhaul of the receive codepath are also
available in the cifs-3.2 branch of my git tree on git.samba.org:

    git:    git://git.samba.org/jlayton/linux.git
    gitweb: http://git.samba.org/?p=jlayton/linux.git;a=shortlog;h=refs/heads/cifs-3.2

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   |  356 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/cifs/connect.c   |  167 +++++++++++++++---------
 fs/cifs/file.c      |  293 ++++++++++++++++++------------------------
 5 files changed, 609 insertions(+), 235 deletions(-)

-- 
1.7.6.4

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #7)
@ 2011-10-19 13:24 Jeff Layton
       [not found] ` <1319030695-4115-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-10-19 13:24 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

This patchset is a respin to fix a bug that Pavel identified in the
readv error handling, and to also fix up some merge conflicts that crept
in with some other patches that Steve merged recently. Other than those
changes, this is essentially the same patchset as the earlier versions
in this series.

This set is also available via my git tree on samba.org:

    http://git.samba.org/?p=jlayton/linux.git;a=summary

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   |  359 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/cifs/connect.c   |  167 +++++++++++++++---------
 fs/cifs/file.c      |  293 ++++++++++++++++++------------------------
 5 files changed, 612 insertions(+), 235 deletions(-)

-- 
1.7.6.4

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #5)
@ 2011-09-06 14:27 Jeff Layton
       [not found] ` <1315319241-21637-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-09-06 14:27 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

The changes since the last patchset are fairly minor. It occurs to me
that it would be better to simply have the default rsize set to a low
value when the server's MaxBufferSize is very small, instead of making
that a hard maximum value. That way, when users know that their server
can support a larger rsize they can force the value higher.

There's also a more subtle change -- when there is a problem with the
read that occurs after adding the page to the pagecache, the page is no
longer removed from the cache. It's possible that in the intervening
period that another task has found that page and is waiting on it, and
might become discombobulated if it's suddenly removed from the cache.

Instead, the code just leaves the page in place and puts it on the LRU
list, but doesn't set it uptodate. This more closely parallels what
other filesystems do in their readpages operations.

This patchset uses the infrastructure added in the receive path overhaul
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   |  356 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/cifs/connect.c   |  165 +++++++++++++++---------
 fs/cifs/file.c      |  293 ++++++++++++++++++------------------------
 5 files changed, 608 insertions(+), 234 deletions(-)

-- 
1.7.6

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #4)
@ 2011-09-01 21:29 Jeff Layton
       [not found] ` <1314912588-20435-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-09-01 21:29 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

Yet another readpages patchset...

The earlier ones caused a regression against very old servers such as
win9x-era servers. Those hosts have very small buffers, and tend to
throw errors when you request a read that's "too big".

This set solves this by essentially punting on doing any readahead at
all in that situation. With such a low rsize, it wouldn't likely be very
helpful anyway. We can revisit this decision later if someone presents a
common use case that would be helped by this.

Currently it tries to detect this situation by detecting when the
server's MaxBufferSize is less than a page. This is sort of a hack. The
server's maxBuf should have no bearing on how much the client can
receive in a read.

I don't see a better way to automatically detect this however as the
server doesn't seem to send anything that says "don't send me read
requests bigger than this". Suggestions are welcome if you have them.

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   |  169 ++++++++++++++++---------
 fs/cifs/file.c      |  282 ++++++++++++++++------------------------
 5 files changed, 602 insertions(+), 234 deletions(-)

-- 
1.7.6

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #3)
@ 2011-08-30 14:46 Jeff Layton
       [not found] ` <1314715574-23431-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-08-30 14:46 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

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

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously
@ 2011-08-26 19:18 Jeff Layton
       [not found] ` <1314386298-27424-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Layton @ 2011-08-26 19:18 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

This patchset uses the infrastructure added in the first set to allow
cifs to vastly increase the rsize. It also is more efficient and does
less copying as the read of the data is all done directly into the
pagecache.

Additionally, readpages is now done asynchronously with this set.
cifs_readpages just puts the pages in the cache, and fires off the
reads and returns. Eventually, when the reads complete, the pages
are marked Uptodate, unlocked, etc.

With this set in place, I see a dramatic increase in performance
for buffered read calls. On a simple dd test of 100M or so:

prepatch, with 16k rsize:
104857600 bytes (105 MB) copied, 5.08086 s, 20.6 MB/s

postpatch, with 1M rsize:
104857600 bytes (105 MB) copied, 1.2141 s, 86.4 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 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 set default to 1M
  cifs: don't discard readahead pages that are beyond EOF

 fs/cifs/cifspdu.h   |    4 +-
 fs/cifs/cifsproto.h |   23 ++++
 fs/cifs/cifssmb.c   |  313 +++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/cifs/connect.c   |  127 ++++++++++++---------
 fs/cifs/file.c      |  272 ++++++++++++++++----------------------------
 5 files changed, 509 insertions(+), 230 deletions(-)

-- 
1.7.6

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-10-19 13:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11 12:35 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #6) Jeff Layton
     [not found] ` <1318336527-13648-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-11 12:35   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton
2011-10-11 12:35   ` [PATCH 2/5] cifs: add cifs_async_readv Jeff Layton
     [not found]     ` <1318336527-13648-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-19 10:01       ` Pavel Shilovsky
     [not found]         ` <CAKywueR=sXusGdOuAvJHTk1FGURHuDXjj6gz4iJRYeu=Zgkfpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-19 10:59           ` Jeff Layton
2011-10-11 12:35   ` [PATCH 3/5] cifs: convert cifs_readpages to use async reads Jeff Layton
2011-10-11 12:35   ` [PATCH 4/5] cifs: allow for larger rsize= options and change defaults Jeff Layton
     [not found]     ` <1318336527-13648-5-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-12 12:22       ` Pavel Shilovsky
     [not found]         ` <CAKywueRHKSrYLmebgSvcfOrrZ=jRC8ELL+Vt0j91orHMLtUVvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-12 12:31           ` Jeff Layton
2011-10-11 12:35   ` [PATCH 5/5] cifs: tune bdi.ra_pages in accordance with the rsize Jeff Layton
  -- strict thread matches above, loose matches on Subject: below --
2011-10-19 13:24 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #7) Jeff Layton
     [not found] ` <1319030695-4115-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-10-19 13:24   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton
2011-09-06 14:27 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #5) Jeff Layton
     [not found] ` <1315319241-21637-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-09-06 14:27   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton
2011-09-01 21:29 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #4) Jeff Layton
     [not found] ` <1314912588-20435-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-09-01 21:29   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton
2011-08-30 14:46 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously (try #3) Jeff Layton
     [not found] ` <1314715574-23431-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-08-30 14:46   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton
2011-08-26 19:18 [PATCH 0/5] cifs: allow cifs to do readpages larger and asynchronously Jeff Layton
     [not found] ` <1314386298-27424-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-08-26 19:18   ` [PATCH 1/5] cifs: fix protocol definition for READ_RSP Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.