From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 11/19] drbd: Fix spurious disk-timeout
Date: Thu, 30 Jul 2015 13:21:46 +0200 [thread overview]
Message-ID: <1438255314-14877-12-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1438255314-14877-1-git-send-email-philipp.reisner@linbit.com>
From: Lars Ellenberg <lars.ellenberg@linbit.com>
(You should not use disk-timeout anyways,
see the man page for why...)
We add incoming requests to the tail of some ring list.
On local completion, requests are removed from that list.
The timer looks only at the head of that ring list,
so is supposed to only see the oldest request.
All protected by a spinlock.
The request object is created with timestamps zeroed out.
The timestamp was only filled in just before the actual submit.
But to actually submit the request, we need to give up the spinlock.
If you are unlucky, there is no older still pending request, the timer
looks at a new request with timestamp still zero (before it even was
submitted), and 0 + timeout is most likely older than "now".
Better assign the timestamp right when we put the
request object on said ring list.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
drivers/block/drbd/drbd_req.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index e9981b5..26c194d 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1166,7 +1166,6 @@ drbd_submit_req_private_bio(struct drbd_request *req)
* stable storage, and this is a WRITE, we may not even submit
* this bio. */
if (get_ldev(device)) {
- req->pre_submit_jif = jiffies;
if (drbd_insert_fault(device,
rw == WRITE ? DRBD_FAULT_DT_WR
: rw == READ ? DRBD_FAULT_DT_RD
@@ -1309,6 +1308,7 @@ static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request
&device->pending_master_completion[rw == WRITE]);
if (req->private_bio) {
/* needs to be marked within the same spinlock */
+ req->pre_submit_jif = jiffies;
list_add_tail(&req->req_pending_local,
&device->pending_completion[rw == WRITE]);
_req_mod(req, TO_BE_SUBMITTED);
--
1.9.1
next prev parent reply other threads:[~2015-07-30 11:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 11:21 [PATCH 00/19] RFC DRBD updates for the 4.3 merge window Philipp Reisner
2015-07-30 11:21 ` [PATCH 01/19] drbd: Remove pointless check Philipp Reisner
2015-07-30 11:21 ` [PATCH 02/19] drbd: De-inline drbd_should_do_remote() and drbd_should_send_out_of_sync() Philipp Reisner
2015-07-30 11:21 ` [PATCH 03/19] drbd: Get rid of some first_peer_device() calls Philipp Reisner
2015-07-30 11:21 ` [PATCH 04/19] drbd: Move enum write_ordering_e to drbd.h Philipp Reisner
2015-07-30 11:21 ` [PATCH 05/19] drbd: drbd_adm_attach(): Add missing drbd_resync_after_changed() Philipp Reisner
2015-07-30 11:21 ` [PATCH 06/19] drbd: Fix locking across all resources Philipp Reisner
2015-07-30 11:21 ` [PATCH 07/19] drbd: Backport the "events2" command Philipp Reisner
2015-07-30 11:21 ` [PATCH 08/19] drbd: Backport the "status" command Philipp Reisner
2015-07-30 11:21 ` [PATCH 09/19] drbd: Deletion of an unnecessary check before the function call "lc_destroy" Philipp Reisner
2015-07-30 11:21 ` [PATCH 10/19] drbd: Replace 0 with the more meaningful GFP_NOWAIT Philipp Reisner
2015-07-30 11:21 ` Philipp Reisner [this message]
2015-07-30 11:21 ` [PATCH 12/19] drbd: drop remnants of connector -- we don't use it anymore in drbd 8.4 Philipp Reisner
2015-07-30 11:21 ` [PATCH 13/19] drbd: drbdsetup detach of an unresponsive local disk should not block IO "forever" Philipp Reisner
2015-07-30 11:21 ` [PATCH 14/19] drbd: also bump UUIDs if a diskless primary connects Philipp Reisner
2015-07-30 11:21 ` [PATCH 15/19] drbd: add comment why we want to first call local-io-error, then send state Philipp Reisner
2015-07-30 11:21 ` [PATCH 16/19] drbd: drbd_panic_after_delayed_completion_of_aborted_request() Philipp Reisner
2015-07-30 11:21 ` [PATCH 17/19] drbd: improve network timeout detection Philipp Reisner
2015-07-30 11:21 ` [PATCH 18/19] drbd: fix NULL deref in remember_new_state Philipp Reisner
2015-07-30 11:21 ` [PATCH 19/19] drbd: fix refcount error during detach of an already failed disk Philipp Reisner
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=1438255314-14877-12-git-send-email-philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=axboe@kernel.dk \
--cc=drbd-dev@lists.linbit.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®