All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Meelis Roos <mroos@linux.ee>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	linux-ide@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: 4.16-rc2+git: pata_serverworks: hanging ata detection thread on HP DL380G3
Date: Mon, 2 Apr 2018 15:05:58 -0700	[thread overview]
Message-ID: <20180402220558.GK388343@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <alpine.LRH.2.21.1803301144380.11026@math.ut.ee>

Hello, Meelis.

Can you please verify whether the following patch fixes the problem?

Thanks.

Subject: blk-mq: Directly schedule q->timeout_work when aborting a request

Request abortion is performed by overriding deadline to now and
scheduling timeout handling immediately.  For the latter part, the
code was using mod_timer(timeout, 0) which can't guarantee that the
timer runs afterwards.  Let's schedule the underlying work item
directly instead.

This fixes the hangs during probing reported by Sitsofe but it isn't
yet clear to me how the failure can happen reliably if it's just the
above described race condition.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Sitsofe Wheeler <sitsofe@gmail.com>
Reported-by: Meelis Roos <mroos@linux.ee>
---
 block/blk-timeout.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index a05e367..f0e6e41 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -165,7 +165,7 @@ void blk_abort_request(struct request *req)
 		 * No need for fancy synchronizations.
 		 */
 		blk_rq_set_deadline(req, jiffies);
-		mod_timer(&req->q->timeout, 0);
+		kblockd_schedule_work(&req->q->timeout_work);
 	} else {
 		if (blk_mark_rq_complete(req))
 			return;

  parent reply	other threads:[~2018-04-02 22:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  9:13 4.16-rc2+git: pata_serverworks: hanging ata detection thread on HP DL380G3 Meelis Roos
2018-03-29  8:54 ` Meelis Roos
     [not found]   ` <CGME20180329101255epcas2p22aeb95d869cdd2954bb9183037dace5f@epcas2p2.samsung.com>
2018-03-29 10:12     ` Bartlomiej Zolnierkiewicz
2018-03-29 10:50       ` Meelis Roos
2018-03-30  8:47       ` Meelis Roos
2018-04-02 16:24         ` Tejun Heo
2018-04-02 22:05         ` Tejun Heo [this message]
2018-04-03  8:22           ` Meelis Roos

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=20180402220558.GK388343@devbig577.frc2.facebook.com \
    --to=tj@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    /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 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.