Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2420493imm; Thu, 2 Aug 2018 11:15:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc0gstNUnXRgOiYdyHs0u5koE5fR2TuOxtmYLVICIYERufxPwrr5ao8fmiref3AGDriIDRl X-Received: by 2002:a62:d34a:: with SMTP id q71-v6mr594982pfg.17.1533233734655; Thu, 02 Aug 2018 11:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533233734; cv=none; d=google.com; s=arc-20160816; b=0dA9kOuhLukJ/G+uc4ziwI5cEz1+7/us1JtsgGZ/k+e0OuAkjDPe8PQ0pz3OQ066iu Q9cNap4keb314Hrn8fqm6gY26ez6HrwWJr+93zCfhqcSNoRVEpRTdEf/Eb2Nlz5+YX4C 50jGwtCTMICFiqOwn2PUtxt7Y4WOZ48uhvnBTt0dSjMV2/h+drOJRtwRA3hpLTmpMhNY V+n/gHtN++MSUNk++c0Gw4jN0L6TC2ZPaAEm8RoqpVGfceWVv/P0W11ELuHQufIClgYi dkdvbqlIv/PH0aS4lWm5cdPeAZVOUs9Ei4Jcn/Un1gkDx+fnxMIGWf5fokAzNtKMYkFg dP7A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=DWKPVMHB8HiQnQUpWWXzSJ+RkhD+9kIYuWUSuxWdg4E=; b=khQYkeItqsITmKHMjbYvpz0GicuTiqyF9MKLG14eyK148Y/QIlJ8iGF9T0yiMsBy3e aoq6MgoAI0jCmWmSfeJPJaZkEnhxKP2yreO/G1wXfFRbmLjBg62t4cMdikX5i3zMLjq0 gAsBAJOMzefv8NCUJHyFTW6te+xDJ5EOhRm37ACM5zuOTynVX6ETlp4MyOkn4nyeUHRp jxZXrOEvCjpPAnQlStxDWHJKa5rRYygKzrEMa4iCT7xTrd3kOeMG5ackpA2rlQzNjmpq RcVlXTSHLrUf6Vsez7I/A572mmFTo+ZOaVqAJ+esztGQewGHI/XKSvIWZmEuPBGMiauv Fpxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=eUSgoABO; 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 b7-v6si2770419pfc.352.2018.08.02.11.15.19; Thu, 02 Aug 2018 11:15:34 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=eUSgoABO; 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 S1732207AbeHBTA1 (ORCPT + 99 others); Thu, 2 Aug 2018 15:00:27 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:40018 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732177AbeHBTA1 (ORCPT ); Thu, 2 Aug 2018 15:00:27 -0400 Received: by mail-it0-f66.google.com with SMTP id h23-v6so4404347ita.5 for ; Thu, 02 Aug 2018 10:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DWKPVMHB8HiQnQUpWWXzSJ+RkhD+9kIYuWUSuxWdg4E=; b=eUSgoABOrtWPWnIxLMvKEJ1/KKcYwmMFxWc96b6wpSpM14GuW2f3jsF4xQr+lzYldE cESFWuTZcdC1AcfjiJS6RL6+YgCdPsSXE5D68g/c150o4TtDocswu5IqenH4kyai8nwG FPcXwB+h78sL8pqhi91M5qwyFnibTwaYmmzb1+0YvibE/ygM5/woNlx5v8sqg1ZjCEkP 2yBN72IPTTVUUl4WSZ7yZM8pNrro2a2l7M9WqWHRBjsXS1aD3sk7NAbYaROlD6ETGfkv v7mxLaJ/Bd6fiIODZWrEfWaQeb8baCW66JJJ5gcEjM3dBE32LlhGI4XSUKgyPboP75MZ kHdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DWKPVMHB8HiQnQUpWWXzSJ+RkhD+9kIYuWUSuxWdg4E=; b=cxd2e6JPK+U+kGyM5Z49B3wO0haNx/ydlpeVAbMV04KwqYz6nhyKT7v3GgNddfOs/S Ljd+hJGOE4ASOjcZUtBPyQrqaiTcS01mqLk9YOE4KmbxAfuGqY5E0LRHaeBYyqbWArM4 It1Si984VgfW3q84WK8Ns76+s0VNd1miZVbWinkBwmtUMUFlJj0aaA0/xmLxa3AfxerV NEMKkhwvb23YUfxUI9qQ6KYZ5mqxurKN/CvW3jgZxhInIomesv7We9LymooMAxOnPWWq 8ILgtoXNr/3Ybz0eNMxgl1C8xGnQ7oxN1wa2an0QCmWCPk6RDWAaF7ohi4AQCB3EhN9x pWtA== X-Gm-Message-State: AOUpUlEJZVGPBMctxBlDZ/or8qQO4WL2ocQ8UEuZ+Nwx+0zQtebW3fSH 1QYBjobWSQV5D5b+qQW/FAyXC2Si2LA= X-Received: by 2002:a24:54d:: with SMTP id 74-v6mr3241025itl.96.1533229705791; Thu, 02 Aug 2018 10:08:25 -0700 (PDT) Received: from [192.168.1.212] (107.191.0.158.static.utbb.net. [107.191.0.158]) by smtp.gmail.com with ESMTPSA id g23-v6sm649248iob.88.2018.08.02.10.08.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Aug 2018 10:08:24 -0700 (PDT) Subject: Re: [PATCH] blk-mq: fix blk_mq_tagset_busy_iter To: Ming Lei , James Bottomley Cc: 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 References: <20180802164329.11900-1-ming.lei@redhat.com> <1533228846.3915.17.camel@HansenPartnership.com> <20180802170601.GC8928@ming.t460p> From: Jens Axboe Message-ID: Date: Thu, 2 Aug 2018 11:08:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180802170601.GC8928@ming.t460p> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/18 11:06 AM, Ming Lei wrote: > 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. I'll add that, would also love a tested-by from the reporter. The patch looks good to me, however. -- Jens Axboe