Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2793919iog; Mon, 20 Jun 2022 05:04:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMwXsRNGUNG1PjgYKsIZMzqu1enNhMa1JrtZLRvzjJWx484q6OUHcMZHcvwscrAz4uwOOn X-Received: by 2002:aa7:d5c9:0:b0:435:8099:30e6 with SMTP id d9-20020aa7d5c9000000b00435809930e6mr6406257eds.384.1655726673204; Mon, 20 Jun 2022 05:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655726673; cv=none; d=google.com; s=arc-20160816; b=gQwDdE+ro6wbGt0jTtR3UggHQ7UZSRHMTxevy/WC1CJGIUSWdX6ZOo1b0sZoK3aYTJ 9N9baT4sM80pfu1zeLsElW0IJI/7BSL9ufTwYt2gFM4WoVT8rJzvT8M566W+oAPAoJj3 v4B196qMQ5RhBAyRDbl3WXdTXAsDo6+nbZl+Ces+F/OmFZYJLBqm5QMHVheRDENqZkTF Dutb+5VCzHCDv/ZK5EzevKTb6Xau1Y7c6+RVk+7xjhA1Wzk5lComR1QqKSFay7JbiG09 i9YNzfMg5Z2jx7xsaSRnV8//w4dZf98439Ao39p7ojSnDt5fevFDBopOGX8sNrMszdfO 2V1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=+wkpLj1K+yPjMRJxi8utxl0ln69LqNl6bk/oJMw1gi4=; b=UlbVAYXXV6yGxwdJ2T0cMsdpGIJBB9Rg4h14kz14ECSnOFUH0S5hkb0Zqyyhn3Rqzt lHRU2uKcGRMrMZPa3L23/3QPpagNhb9sX8E0uLy7R3ZePFzKkNZ1ICZH9yIcOFGMB26W Mu1wwxo1wGxJE6tf1MywWcgk+/q8LNi08PrSe4IdcoTpW2kkeKfwCN5vBsoUGwvmbjS2 VRAEt1IXS/ZUl0/FLA7iVMBv1lBENQJ/UCn38P9EsgCzhvIen0YBzcpL3mKY1KKuQfWO VgrfwJSXvEo4qUllx0vPokXNDVHDRwfBQqIn5FAAXokMFx/jFiZaG/6RYNywUzEyI+iB JXDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=g5wKTYdS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn28-20020a1709070d1c00b006dff4dd30f9si11106194ejc.862.2022.06.20.05.03.41; Mon, 20 Jun 2022 05:04:33 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=g5wKTYdS; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241992AbiFTL4j (ORCPT + 99 others); Mon, 20 Jun 2022 07:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbiFTL4h (ORCPT ); Mon, 20 Jun 2022 07:56:37 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2865617E03; Mon, 20 Jun 2022 04:56:37 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DA00A21B73; Mon, 20 Jun 2022 11:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1655726195; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+wkpLj1K+yPjMRJxi8utxl0ln69LqNl6bk/oJMw1gi4=; b=g5wKTYdSVahRen1Xx4ZVdANCmeFmjoi1EBy2+EXhQj5rhUeouBHw0KBx+D3YR3oHBfcIyj 28t+BypWrSMddQIJPVhLC3xnTIm/70iAMX4vIpK2Lc6JiiGwBE/wWM8fGcKY6LOUIe1RrX 26nadAcchEElh1vnT54ytH/5QTS8iZo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1655726195; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+wkpLj1K+yPjMRJxi8utxl0ln69LqNl6bk/oJMw1gi4=; b=8OP+PeX7Ag28Hlzm51S2jXkO8equavYlE3ZtDEYXl+ptjPVEPWhEB31PHL8TPGL1WXTi0Z PjfrpXODVaW6/RDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C7FD7134CA; Mon, 20 Jun 2022 11:56:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0lWkMHNgsGIKEQAAMHmgww (envelope-from ); Mon, 20 Jun 2022 11:56:35 +0000 Message-ID: <22bedb25-63ee-3106-f37d-b4ef19ac9e6f@suse.de> Date: Mon, 20 Jun 2022 13:56:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-US To: Damien Le Moal , Christoph Hellwig Cc: John Garry , Bart Van Assche , axboe@kernel.dk, jejb@linux.ibm.com, martin.petersen@oracle.com, brking@us.ibm.com, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, chenxiang66@hisilicon.com 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> <20220620090543.GA13643@lst.de> <41fa0f12-cdcf-f2c4-7366-1abd04312f1f@opensource.wdc.com> From: Hannes Reinecke Subject: Re: [PATCH RFC v2 03/18] scsi: core: Implement reserved command handling In-Reply-To: <41fa0f12-cdcf-f2c4-7366-1abd04312f1f@opensource.wdc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 6/20/22 13:24, Damien Le Moal wrote: > On 6/20/22 18:05, Christoph Hellwig wrote: >> 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. > > Thanks. Will check. > I am also looking at scsi_unjam_host() and scsi_eh_get_sense(). These > reuse a scsi command to do eh operations. So I could use that too, modulo > making it work outside of eh context to keep the command flow intact. > Tsk. I was hoping to be able to remove it (especially scsi_eh_get_sense()), but looks as if we actually do need it. But it might be not a bad idea to have scsi_eh_get_sense() to run independent on the SCSI EH stuff; returning with a sense code is not necessary an error, so there are reasons for not always invoking SCSI EH. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer