Received: by 10.213.65.68 with SMTP id h4csp4371078imn; Tue, 10 Apr 2018 13:53:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx48b7grgL5IipA0KVv4uGy22hMpeo0AlJO0j/qDalu7D9lJERldhES7M8o0zbJBfrflaE7V6 X-Received: by 10.98.204.214 with SMTP id j83mr1626197pfk.182.1523393584791; Tue, 10 Apr 2018 13:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523393584; cv=none; d=google.com; s=arc-20160816; b=GcJ4Cr6BGB6hDwddNq2Hs9REMZxjM2TrVqxoNyp5gigpUArosG2BX3tb/GXOoIrgp1 6reDEFQmUHhDaPbHlOYroGaUbHGEtpvwYVKPECoK0dEd8CkbgN/jbGc4g1v+MyiX/V3y HYxM3n0SCvWz2Wqhjt/TfEQhqVr3m1rrz5U5ZrZEbtPH+gG4RoPZnI96gVTjdH7pnuu6 VQY5z4QR/yctQvxOg3MajXGIpkFx1CYtTDSbR7LFDNx9dcOAk6ODQPFW69w6FcRkhr+4 zSCnAyYZTktGArg1o0d3TSwh+p/UQXXUmmK63oHni4vETZqKRF346Q2RFLmolTSCmPxv DxRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=F2A71pKZBX8Ei5WHbTlRs7LZs7ZTK2IP8OOwkzW9b5w=; b=HyfREHULTSTZxF2hSVM9H/+hzJavDZAGW55zpDKMmnxJxrKnVh/5boBRcfneYQZTbe zPm+RIuFwvI2sm4ThK8n4Ka36yfOFK+KlUN/r9gjLOh9NrSF70ZwIkZsZW8rrHHILImy h7o4D7apB24MdJ+Uj2RGcEpkRB/ixG2NS9dZD0bmlzTB52SFhQCZQK/StgiDaiRuLXFb XSXzLs5m6pYt7vhgdtX+I63bWDOLihPMlvwaUoToFHAtL0SIw7Sa2+R95z4XNWd5TjvW iqECbPFSRXiNB0TcNwuiHXB6t/Eze6tm5dQQW7rXbTGWWBaFy2enI7pVhhZdrqUXzKdj ep2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n29si2216993pgd.778.2018.04.10.13.52.26; Tue, 10 Apr 2018 13:53:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbeDJUqL (ORCPT + 99 others); Tue, 10 Apr 2018 16:46:11 -0400 Received: from mondschein.lichtvoll.de ([194.150.191.11]:37753 "EHLO mail.lichtvoll.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbeDJUqK (ORCPT ); Tue, 10 Apr 2018 16:46:10 -0400 Authentication-Results: auth=pass smtp.auth=martin smtp.mailfrom=martin@lichtvoll.de Received: from 127.0.0.1 (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lichtvoll.de (Postfix) with ESMTPSA id 6C0F32EF6BB; Tue, 10 Apr 2018 22:46:08 +0200 (CEST) From: Martin Steigerwald To: Martin Steigerwald Cc: Tejun Heo , Sitsofe Wheeler , Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Bart Van Assche Subject: Re: [PATCH] blk-mq: Directly schedule q->timeout_work when aborting a request Date: Tue, 10 Apr 2018 22:46:07 +0200 Message-ID: <2410059.9M3ptFeZvf@merkaba> In-Reply-To: <2699418.6CV4rbzP8d@merkaba> References: <20180402220458.GJ388343@devbig577.frc2.facebook.com> <2699418.6CV4rbzP8d@merkaba> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Martin Steigerwald - 10.04.18, 20:43: > Tejun Heo - 03.04.18, 00:04: > > 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. > > Compiling a 4.16.1 kernel with that patch to test whether this fixes > the boot hang I reported in: > > [Possible REGRESSION, 4.16-rc4] Error updating SMART data during > runtime and boot failures with blk_mq_terminate_expired in backtrace > https://bugzilla.kernel.org/show_bug.cgi?id=199077 Fails as well, see https://bugzilla.kernel.org/show_bug.cgi?id=199077#c8 for photo with (part of) backtrace. > The "Error updating SMART data during runtime" thing I reported there > as well may still be another (independent) issue. > > > Signed-off-by: Tejun Heo > > Reported-by: Sitsofe Wheeler > > Reported-by: Meelis Roos > > Fixes: 358f70da49d7 ("blk-mq: make blk_abort_request() trigger > > timeout path") Cc: stable@vger.kernel.org # v4.16 > > Link: > > http://lkml.kernel.org/r/CALjAwxh-PVYFnYFCJpGOja+m5SzZ8Sa4J7ohxdK=r8 > > NyOF-EM A@mail.gmail.com Link: > > http://lkml.kernel.org/r/alpine.LRH.2.21.1802261049140.4893@math.ut. > > ee --- Hello, > > > > I don't have the full explanation yet but here's a preliminary > > patch. > > > > Thanks. > > > > 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; -- Martin