Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2697379iog; Mon, 20 Jun 2022 02:42:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ug0whwv3dghuMujHrBS2KYZRuYgOIwpyrPD9wqHtam/MhwVGht5lRMBaDQiZV4Fey7IJ6u X-Received: by 2002:a17:902:e141:b0:16a:46c:dd3b with SMTP id d1-20020a170902e14100b0016a046cdd3bmr16712099pla.113.1655718172437; Mon, 20 Jun 2022 02:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655718172; cv=none; d=google.com; s=arc-20160816; b=VswCEL2qnEbLTJolQwKC9+SaZKX968SKaaqOQOKzWgTqQjq1CF1N+gXehiuyN6nJz+ U9O4J6dm5m8Tv+Bpmc7eNmiJXfqf8V2pT6GiHtVXXC4cruM9g6ObIRes2QKif0ZM0sUj 1biffVKZKqsRqA0RfZXsaQtnuZPYViZ1Fmd9hDfwzePb8Qfaq+jc49lUVPTqc9XTVRhf eo/oYaJz3maKShVykkFfxSVwbsvWI/xVbIvfkNgSeZvvN7WKZFpQ0uknO5eHNcKjpCTh GMhUPbrtiNyFkIQ/vbkttjB6wrmF9qvIET8fOSdfbye8RD2KKMUaReHXYDkQpYmYJ+vU mCLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pFzwBhKCshoux5uBCKclGJO9IC3ktLvNjFMaMfE9pQQ=; b=siBdyyxgkrcMe94Zd61iUgyWa8Vlj1zxdxRzez2q/nq/yEDKl9Qt4/2xsfIdfDG4/m E/hNRsGLWFJ0yEmlgaWcp7xwdfD6exqsbl9h2iInYdGb7gGv26CV8ej0yoqtp7b1pW3h yT5rjXaFh9UA8cY6Vcvz7AiRTFaH4F+ky8FNptu9Mu/FzcMgRGJTZrlLHJcmOiFEY8D+ Qgex7jP/TFoi0o69jd+U2JxGijj5d5FItBXtRYVEpyiwxAP+l4jxdqh0TDImYYrBw3ps 0GrAAz9gQm7FpxHYEqIDfT463kWT4EuYXFTi84WIgtgp3Mha3T6fn01C+KT+7rpTSvjy xT0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a056a001ac600b0051c274ce486si12988509pfv.298.2022.06.20.02.42.40; Mon, 20 Jun 2022 02:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240494AbiFTJGD (ORCPT + 99 others); Mon, 20 Jun 2022 05:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240492AbiFTJFs (ORCPT ); Mon, 20 Jun 2022 05:05:48 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8975DFC; Mon, 20 Jun 2022 02:05:47 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 6E8CE68AA6; Mon, 20 Jun 2022 11:05:43 +0200 (CEST) Date: Mon, 20 Jun 2022 11:05:43 +0200 From: Christoph Hellwig To: Damien Le Moal Cc: Hannes Reinecke , John Garry , Bart Van Assche , axboe@kernel.dk, jejb@linux.ibm.com, martin.petersen@oracle.com, brking@us.ibm.com, hch@lst.de, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, chenxiang66@hisilicon.com Subject: Re: [PATCH RFC v2 03/18] scsi: core: Implement reserved command handling Message-ID: <20220620090543.GA13643@lst.de> References: <1654770559-101375-4-git-send-email-john.garry@huawei.com> <9e89360d-3325-92af-0436-b34df748f3e2@acm.org> <3a27b6ff-e495-8f11-6925-1487c9d14fa9@huawei.com> <98fa010d-3555-a82b-e960-f47aeeb38151@opensource.wdc.com> <7b046321-fdb3-33f0-94a0-78a25cbbe02e@suse.de> <9de5ed1b-e874-28ac-0532-cd5420892064@opensource.wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9de5ed1b-e874-28ac-0532-cd5420892064@opensource.wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20, 2022 at 06:02:30PM +0900, Damien Le Moal wrote: > So reserving a tag/req to be able to do NCQ at the cost of max qd being 31 > works for that. We could keep max qd at 32 by creating one more "fake" tag > and having a request for it, that is, having the fake tag visible to the > block layer as a reserved tag, as John's series is doing, but for the > reserved tags, we actually need to use an effective tag (qc->hw_tag) when > issuing the commands. And for that, we can reuse the tag of one of the > failed commands. Take a look at the magic flush request in blk-flush.c, which is preallocated but borrows a tag from the request that wants a pre- or post-flush. The logic is rather ugly, but maybe it might actually become cleaner by generalizing it a bit.