Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp549303img; Mon, 18 Mar 2019 08:54:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG1y401EX8QeewYiCxCRBQtjWIIysd0ElpdXmdVxsF1pN2FdbjxmFdmhfgLF1PzrA6laO0 X-Received: by 2002:aa7:8d01:: with SMTP id j1mr20286328pfe.122.1552924488200; Mon, 18 Mar 2019 08:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552924488; cv=none; d=google.com; s=arc-20160816; b=B42lOWFEY+px7K5DMQHaUBsHO1xs2n3YXI4gGwWbBbpQzdZfPe7Vq74Zao6SetFnVJ sarTZiwpgncqzqVR9RbjQtbFOMAqBzuN+tY0V2Y3eyDVUp1ZfhPk97f+8NC4yB7VIjPs f9JZzTZQd5CLaSLqEVwxVY5KRNFQO4BFnjEbwHbatoIetmlkro6qseDNmWe5egQfebyc 5TnFbsbVM8MtY8euwkxMepX1/V8KtZ+Iu6WSeFa6PlJd/u6CuUWYMg5Dx5GPpIBO2wB8 KCFkkMNIA+J4Z9F86jvs5wWbLrWvEundl/9gJOPqZXFppmHGM7oQ2esZbJAFjCNSWBA6 r8jw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bu4uHzTyPO4IvMYbLlO79WD9SZbzDXmjb2pseayc+bE=; b=V+Tu355pATgW0XUsJRdreG0mZP3lfJwSE/VkBh5m+Vxa6pVZY01mBqCiK/GniE2yKc lN05ToCv91ffGNMBn7uw1gWamXtrBFa1MrWpMShEz1ZoPlgR6j30blrsfi98y0+pTfbR Ho+NBHHznhBNKNK1I8c9L0z+t2BmicUkaKU2tIFAi/SkSUMaAgbbskysqOqaYDCGiezQ ZMzZvpunQF0sBqKdR2eFOcG/lBaJCMdQV4L2ikWoi8rskbtzDQBfSnWLw+OAaFyJpcLK CZdPHiAU40TC/27jwlDLvH7Njyh1a90zH3TN9A/7/B5W/K/vS0LI0gTuKLjGa9Im/PE+ gdHw== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si5869507pll.236.2019.03.18.08.54.33; Mon, 18 Mar 2019 08:54:48 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbfCRPwe (ORCPT + 99 others); Mon, 18 Mar 2019 11:52:34 -0400 Received: from mga12.intel.com ([192.55.52.136]:18026 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbfCRPwe (ORCPT ); Mon, 18 Mar 2019 11:52:34 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 08:52:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,494,1544515200"; d="scan'208";a="141703258" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by FMSMGA003.fm.intel.com with ESMTP; 18 Mar 2019 08:52:33 -0700 Date: Mon, 18 Mar 2019 09:53:26 -0600 From: Keith Busch To: Ming Lei Cc: Jianchao Wang , "axboe@kernel.dk" , "linux-block@vger.kernel.org" , "jsmart2021@gmail.com" , "bvanassche@acm.org" , "josef@toxicpanda.com" , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "Busch, Keith" , "hare@suse.de" , "jthumshirn@suse.de" , "hch@lst.de" , "sagi@grimberg.me" Subject: Re: [PATCH 2/8] blk-mq: change the method of iterating busy tags of a request_queue Message-ID: <20190318155326.GB23533@localhost.localdomain> References: <1552640264-26101-1-git-send-email-jianchao.w.wang@oracle.com> <1552640264-26101-3-git-send-email-jianchao.w.wang@oracle.com> <20190315161608.GB15153@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 16, 2019 at 11:50:27PM -0700, Ming Lei wrote: > On Sat, Mar 16, 2019 at 12:15 AM Keith Busch wrote: > > On Fri, Mar 15, 2019 at 01:57:38AM -0700, Jianchao Wang wrote: > > > + if (rq && rq->q == hctx->queue && > > > + rq->mq_hctx == hctx && > > > + (!iter_data->inflight || > > > + blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT)) > > > + return iter_data->fn(rq, iter_data->data, reserved); > > > > There is still a window where the check may succeed, but the request is > > being assigned to a completely different request_queue. The callback > > then operates on a request it doesn't own. > > The situation above is only related with 'none' io scheduler. > > However, this patch doesn't change behavior for none given .rq[tag] is same with > .static_rq[tag], so I guess your concern may not be related with this patch. Right, it's not new, but queue iteration wasn't exported for drivers before this.