Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp599306ima; Fri, 15 Mar 2019 09:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBqXFYMTPw4vLhM83UNJLIOegzbEAE0OPTpXUSzCpsjR9o42oU+xpYeRoCxfddv8DUcXHS X-Received: by 2002:a63:fb0b:: with SMTP id o11mr4272036pgh.222.1552668051023; Fri, 15 Mar 2019 09:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552668051; cv=none; d=google.com; s=arc-20160816; b=Ynw4kbOVSHbIcUNUEF94UO1NdV38ezu/sKpedjbMjMowTCh1PuB6llo/gMKn64vjG3 fPQVRNOQ7+w/L4eGJo2eMwimtrcTmiADG/MLOGakg3mawaGdXPtQKLFulaZc/glrx6dD zCEFFPEVMpw46mqoF+AjLwABwgY8siS0Y4iBcVwAM8F7i0Fdqp07EfJnjW2OtI2mSw94 +80gPKsoI3kvg4rQsziWQ3A0i1SMMbONv3gsFYh+shX0MxHVXhMSKNz4P3QXC0EjhcnA YJmiyuDqmnSo29wM6+Oi2Bw7V+NXY18bOS3E4FgHrTcOroUxBKJxLpAxbrLLpexhStxN kK9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=4mz+ylSIlqICAal8h3K0TtTG87LIv/NBo2Pti8a7xbY=; b=JkuaB1gIqRWIkOdT7yxlLLIVwiprQviQyPAM6z5uRX9McGwKUr5B40+itg8Qo/lx4w FCvH/7KsSvUUbMKvasJHv+qBvSO0Njw60WHT/ZsttMDcwlsXd+Yo9agFCa8l2okkfiYX RobWHPMPiyZUVMrR3Z1PbWg3HfTsAh4rgpbfvmUinhlWkV5rfH4a3V6Ez3Eetv4A6myb 43OMwjpg/wf9yxQstlay4jCOJlt52XtA2GZhkPnesAFVVVuhobNO8oxef7ckj75t7Has gH8T3FPQVls5ImGtTb1JNFQkuqCoFirVDKlnR9iTsnu2bvf+4HuE8Y2+eeUT5gCsOoZI OAYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=K9ZdrmUe; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si2204407plf.288.2019.03.15.09.40.34; Fri, 15 Mar 2019 09:40:51 -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=@broadcom.com header.s=google header.b=K9ZdrmUe; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729525AbfCOQjs (ORCPT + 99 others); Fri, 15 Mar 2019 12:39:48 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35784 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728271AbfCOQjs (ORCPT ); Fri, 15 Mar 2019 12:39:48 -0400 Received: by mail-pg1-f193.google.com with SMTP id e17so6846751pgd.2 for ; Fri, 15 Mar 2019 09:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=4mz+ylSIlqICAal8h3K0TtTG87LIv/NBo2Pti8a7xbY=; b=K9ZdrmUerygXPE45fwfRYoSkH4CRrsq8Hglken/WCC+11t53cCEF+PvQd9AEE1pbab hJVTouUWEjjZnBC9FNFol/GlbZ1t1tRDCt1h1OcggzEHFHPUz4Am42bGETSVeeyxDbuz D4pTH1NG/vVoU7PtU0iP1EcnE6cSYg55bxrms= 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-transfer-encoding :content-language; bh=4mz+ylSIlqICAal8h3K0TtTG87LIv/NBo2Pti8a7xbY=; b=Yl+w2XhV1j0FUKUdSJfJsuxmkIPA7B9tq6KqjAIo1ezt6M9Egg+b5HFT5J0VavyTgO oZqwQHjazFTqlmaGAn4LrNMViVaWe4pGe6/G8Sz6uuC69K1VPLvXCdcBSUZyesYLNTgd +liefZOiJ89GCg3djq6Wllz4koimQL6nANHqZ9tguA5k3Kc9EeD0rccNIK+PeeKu+snV FxH7AYo0sTzOLCmK2yrqF5wR8on0BGxgKWHRoda5p0lfPnyBTUjh14h1OGI1oJswzI94 p32Zx2KHr3YXbMuXvHuy3zR8XfTEGqBYh88+VravKJoEla2CMrxFTGGLK42CgV0Vp7hM +H1A== X-Gm-Message-State: APjAAAWiUYT53BCjqLAggd50ELzhnuBiNXD56KX1GioNRZK51tfrqQ68 EoJvnkaV+glkhWRoBCIqPU3qsw== X-Received: by 2002:a65:6098:: with SMTP id t24mr4328362pgu.57.1552667987632; Fri, 15 Mar 2019 09:39:47 -0700 (PDT) Received: from [10.69.37.149] ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id f16sm7301418pga.71.2019.03.15.09.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 09:39:46 -0700 (PDT) Subject: Re: [PATCH 7/8] nvme: use blk_mq_queue_tag_busy_iter To: James Smart , Jianchao Wang , axboe@kernel.dk Cc: linux-block@vger.kernel.org, sagi@grimberg.me, josef@toxicpanda.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, hare@suse.de, jthumshirn@suse.de, hch@lst.de, bvanassche@acm.org References: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> <1552640264-26101-8-git-send-email-jianchao.w.wang@oracle.com> <62de99e8-0d8d-910a-bfdc-649f734b152c@gmail.com> From: James Smart Message-ID: Date: Fri, 15 Mar 2019 09:39:45 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <62de99e8-0d8d-910a-bfdc-649f734b152c@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/15/2019 9:33 AM, James Smart wrote: > On 3/15/2019 1:57 AM, Jianchao Wang wrote: >> blk_mq_tagset_busy_iter is not safe that it could get stale request >> in tags->rqs[]. Use blk_mq_queue_tag_busy_iter here. A new helper >> interface nvme_iterate_inflight_rqs is introduced to iterate >> all of the ns under a ctrl. >> >> Signed-off-by: Jianchao Wang >> --- >>   drivers/nvme/host/core.c   | 12 ++++++++++++ >>   drivers/nvme/host/fc.c     | 12 ++++++------ >>   drivers/nvme/host/nvme.h   |  2 ++ >>   drivers/nvme/host/pci.c    |  5 +++-- >>   drivers/nvme/host/rdma.c   |  6 +++--- >>   drivers/nvme/host/tcp.c    |  5 +++-- >>   drivers/nvme/target/loop.c |  6 +++--- >>   7 files changed, 32 insertions(+), 16 deletions(-) >> >> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c >> index 6a9dd68..5760fad 100644 >> --- a/drivers/nvme/host/core.c >> +++ b/drivers/nvme/host/core.c >> @@ -3816,6 +3816,18 @@ void nvme_start_queues(struct nvme_ctrl *ctrl) >>   } >>   EXPORT_SYMBOL_GPL(nvme_start_queues); >>   +void nvme_iterate_inflight_rqs(struct nvme_ctrl *ctrl, >> +        busy_iter_fn *fn, void *data) >> +{ >> +    struct nvme_ns *ns; >> + >> +    down_read(&ctrl->namespaces_rwsem); >> +    list_for_each_entry(ns, &ctrl->namespaces, list) >> +        blk_mq_queue_tag_busy_iter(ns->queue, fn, data, true); >> +    up_read(&ctrl->namespaces_rwsem); >> +} >> +EXPORT_SYMBOL_GPL(nvme_iterate_inflight_rqs); > > Hmm... so this aborts ios for namespaces. How about ios that aren't > for a namespace but rather for the controller itself.  For example, > anything on the admin queue ?   Rather critical for those ios be > terminated as well. NVM - didn't look at which tag set.  but it does highlight - doesn't cover anything issued by core/transport on the io queues. -- james