Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2363576imm; Thu, 2 Aug 2018 10:18:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdstVx9UFpQyCfqzYev7Ld/OSScFt0FmTDVc1i4j7G1t+ferqLf9JqzO0Rf2e+hJ2XCi8yE X-Received: by 2002:a62:8913:: with SMTP id v19-v6mr366016pfd.127.1533230309403; Thu, 02 Aug 2018 10:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533230309; cv=none; d=google.com; s=arc-20160816; b=xts8aiewIipxtelxnYfGEXoEkrAhiM584SPwLryShvVhTECRNjCckq8X4cu2FY2LyJ jextI6/dMe9v3f3tI4Z5vav8ZFNgsTGnC2hwWEJMnHvdS19vrMkAK3bUBKmD96tNBbuL 7+jIGptSOtBuK0abpH8tnA7l4mkLM8cTsmBtxbh0uD6nEPBTHL8EuzRokYQ8EtabQwlT O5OEAheLIySqMdakVXvGywX7Wv+/putViON78IdrjO09g30DJ6wNfn9vTX28C968pMYE 9TyD4pm5OaORWDlXxSdKl+UKts8GFTlrITUKdKWs4f5M6Py84Z6PEFYenO+rMKmnrk/6 K2OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=TgPx1dv7qVottxMzQlTpMFACrXGJrAX/DVwnSFPGz3Q=; b=BjN7xNgoiD6QNrp0LIBwgYDrocp4ylrngIqt6JGr86CHVmKfItFytOxamA75vm3Lh/ ujqh0LnQeuOieOL7aMIgZb3iQdENIurmJWnIUS07CxnQqujadXrg2bSa9151GzTfIbkS 6+ro7oS6TgKUJHNriNeMR8eQoPknvxG3+yp40VuVWSdzf/QLaF8g+dTlICcnQfL4vFoM xLIqSFVbqSEkKW28tWKVxIszmyeLrEkWnP3I3r/+jbXFFl+pxLS3F/muCxBIJoPcHQsT U4k2dTcGpPmzEE2mJiz+d6OcjIhqLx5usFBu+R50GbQ8X4mzsGbK63YAFDKBguwMUvgK h1Ew== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s184-v6si2512189pgb.161.2018.08.02.10.18.04; Thu, 02 Aug 2018 10:18:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732071AbeHBS6V (ORCPT + 99 others); Thu, 2 Aug 2018 14:58:21 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726636AbeHBS6V (ORCPT ); Thu, 2 Aug 2018 14:58:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8899407119A; Thu, 2 Aug 2018 17:06:19 +0000 (UTC) Received: from ming.t460p (ovpn-12-120.pek2.redhat.com [10.72.12.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 17CCA215670D; Thu, 2 Aug 2018 17:06:06 +0000 (UTC) Date: Fri, 3 Aug 2018 01:06:01 +0800 From: Ming Lei To: James Bottomley Cc: Jens Axboe , linux-block@vger.kernel.org, Josef Bacik , Christoph Hellwig , Guenter Roeck , Mark Brown , Matt Hart , Johannes Thumshirn , John Garry , Hannes Reinecke , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] blk-mq: fix blk_mq_tagset_busy_iter Message-ID: <20180802170601.GC8928@ming.t460p> References: <20180802164329.11900-1-ming.lei@redhat.com> <1533228846.3915.17.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1533228846.3915.17.camel@HansenPartnership.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 02 Aug 2018 17:06:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 02 Aug 2018 17:06:20 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 02, 2018 at 09:54:06AM -0700, James Bottomley wrote: > On Fri, 2018-08-03 at 00:43 +0800, Ming Lei wrote: > > Commit d250bf4e776ff09d5("blk-mq: only iterate over inflight requests > > in blk_mq_tagset_busy_iter") uses 'blk_mq_rq_state(rq) == > > MQ_RQ_IN_FLIGHT' > > to replace 'blk_mq_request_started(req)', this way is wrong, and > > causes > > lots of test system hang during booting. > > > > Fix the issue by using blk_mq_request_started(req) inside > > bt_tags_iter(). > > > > Fixes: d250bf4e776ff09d5 ("blk-mq: only iterate over inflight > > requests in blk_mq_tagset_busy_iter") > > Cc: Josef Bacik > > Cc: Christoph Hellwig > > Cc: Guenter Roeck > > Cc: Mark Brown > > Cc: Matt Hart > > Cc: Johannes Thumshirn > > Cc: John Garry > > Cc: Hannes Reinecke , > > Cc: "Martin K. Petersen" , > > Cc: James Bottomley > > Cc: linux-scsi@vger.kernel.org > > Cc: linux-kernel@vger.kernel.org > > Signed-off-by: Ming Lei > > --- > > ?block/blk-mq-tag.c | 2 +- > > ?1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c > > index 09b2ee6694fb..3de0836163c2 100644 > > --- a/block/blk-mq-tag.c > > +++ b/block/blk-mq-tag.c > > @@ -271,7 +271,7 @@ static bool bt_tags_iter(struct sbitmap *bitmap, > > unsigned int bitnr, void *data) > > ? ?* test and set the bit before assining ->rqs[]. > > ? ?*/ > > ? rq = tags->rqs[bitnr]; > > - if (rq && blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) > > + if (rq && blk_mq_request_started(rq)) > > So now we have dueling versions of this patch: > > https://marc.info/?l=linux-scsi&m=153322802207688 > > Can we at least make sure we've root caused the problem and confirmed > we've got it fixed before we start the formal patch process? When we EH uses scsi_host_busy to check if the error handler needs to be waken up. And blk_mq_tagset_busy_iter() is used for implementing scsi_host_busy(), so causes EH not waken up, then this timed-out request can't be handled. > do start the formal patch process, please give appropriate credit to > the reporter(s) since this has been a royal pain for them to help us > track down. Sure. Jens, could you add reported-by if you are fine with this version? Or please just let me know if new version is needed, then I can add it. Thanks, Ming