Linux NFS development
 help / color / mirror / Atom feed
From: Weston Andros Adamson <dros@primarydata.com>
To: trond.myklebust@primarydata.com
Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson <dros@primarydata.com>
Subject: [PATCH 0/5] pgio: fix buffered write retry path
Date: Fri, 11 Jul 2014 10:20:44 -0400	[thread overview]
Message-ID: <1405088449-11268-1-git-send-email-dros@primarydata.com> (raw)

My recent pgio work added the ability to split requests into sub-page
regions, but didn't handle a few places in the writeback code where
requests are looked up by struct page and may already be split into
multiple requests.

This patchset adds a function "nfs_lock_and_join_requests" in patch
"nfs: handle multiple reqs in nfs_page_async_flush", which:
  - takes mutex lock
  - looks up head request 
  - grabs request lock for each subrequest
     - if unsuccessful, unrolls old locks and waits on subrequest
  - removes all requests from commit lists
  - merges range of subrequests into the head requests
  - unlinks and destroys the old subrequests.

The other patches are related fixes.

The problem showed up when mounting with wsize < PAGE_SIZE - this would
cause multiple requests per page. If a commit failed, nfs_page_async_flush 
would operate just on the head request, leading to a hang.

The nfs_wb_page_cancel patch leverages the same function -
nfs_lock_and_join_requests cancels all operations on the page group.  I've had
a really hard time testing nfs_wb_page_cancel, I've only hit it once in weeks of
testing. Any ideas on how to reliably trigger this is appreciated - it's not
as easy as just kicking off a ton of writeback then truncating. The one time I
did see it was with a ton of i/o on a VM with 256M of RAM, which was swapping
like crazy, along with restarting the server repeatedly (to get commit verifier
mismatch).

Thanks,
 -dros


Weston Andros Adamson (5):
  nfs: mark nfs_page reqs with flag for extra ref
  nfs: nfs_page should take a ref on the head req
  nfs: change find_request to find_head_request
  nfs: handle multiple reqs in nfs_page_async_flush
  nfs: handle multiple reqs in nfs_wb_page_cancel

 fs/nfs/internal.h |   1 +
 fs/nfs/pagelist.c |  18 ++-
 fs/nfs/write.c    | 332 +++++++++++++++++++++++++++++++++++++++++++++---------
 3 files changed, 296 insertions(+), 55 deletions(-)

-- 
1.8.5.2 (Apple Git-48)


             reply	other threads:[~2014-07-11 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 14:20 Weston Andros Adamson [this message]
2014-07-11 14:20 ` [PATCH 1/5] nfs: mark nfs_page reqs with flag for extra ref Weston Andros Adamson
2014-07-11 14:20 ` [PATCH 2/5] nfs: nfs_page should take a ref on the head req Weston Andros Adamson
2014-07-11 14:20 ` [PATCH 3/5] nfs: change find_request to find_head_request Weston Andros Adamson
2014-07-11 14:20 ` [PATCH 4/5] nfs: handle multiple reqs in nfs_page_async_flush Weston Andros Adamson
2014-07-12 21:39   ` Trond Myklebust
2014-07-11 14:20 ` [PATCH 5/5] nfs: handle multiple reqs in nfs_wb_page_cancel Weston Andros Adamson
2015-06-19 10:11 ` [PATCH 0/5] pgio: fix buffered write retry path Benjamin Coddington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405088449-11268-1-git-send-email-dros@primarydata.com \
    --to=dros@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox