Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp303774iog; Mon, 13 Jun 2022 03:07:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAmRfy3C8TiYUZR0LX1pmRLxOZSNPDvOEEsrGkeLsMcqRo1OyheciaVlqTWHNwqHN0xcP8 X-Received: by 2002:a17:906:f198:b0:711:d5a1:6acf with SMTP id gs24-20020a170906f19800b00711d5a16acfmr32298703ejb.627.1655114831455; Mon, 13 Jun 2022 03:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655114831; cv=none; d=google.com; s=arc-20160816; b=gxKOav2HLmDidCXk3xOPnx/vvK4PNeVV08GcZ3VsiRadjQqzLxRBrACRUaMKUBRhhj aiKhgxEr5b+IQQVKJ8uPSBaQWj4CM2SGXlijHYZJeOS/anRb2IyEs//LbnmjV5Evhb2q 3StRq9GaTQXknKSBalRxlZh+7pwJJIoXb6iJU0Os7QAIkZzxOKLca56YviGVk0Q7raHy hx5nSWXhplWMoQ5YtNYfeZ3HK5UlCio4wJrphVGO04zJ4NWJbc9G/GZonUKKxRKx7mLB nk2s+o7WdArFQk5FCaPbsyiGsw5LX3LzTAKVVFMfJBic2/EFYK2NsX5N0d/e7dSOFbSR q+lw== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=T87O7eA+tg7jHBPHTXIH0YZN9+9mkP450FZbS0tvRzo=; b=xtbGeHea6hEsjX8y6GoemXS5IDU88hw1O3kkAMSpnhXCoExUyneKePGvTwou5bAqSk dLgkQWbfftAUuuPrt1TJ6dU7dE7mN9z68gAvlZENFzyJ7Peha5+dSG6hcwceT7oXlLgR bRR58Qo6nSvdLqyQCzyHW5ux0k9PwthVsJj2ifeR9pX6mAoJtx8oN/Y6G5kP6M0I4U37 FRX3Nf6pce5oQnr+z81G+zaYLzmqa3Xy7EDwtjgEJptEfL1CVBH7EadPp4Ct03IdbuFA lo5CZXckMWzQOTd3N5DiioULC8M86yh8IxbRye9Y3BvJJ5Kaaqx4XknL3jfqHMQgHjhz 4Wdg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020aa7cd0a000000b0042bb0e64615si6219977edw.492.2022.06.13.03.06.46; Mon, 13 Jun 2022 03:07:11 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241478AbiFMKDE (ORCPT + 99 others); Mon, 13 Jun 2022 06:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241439AbiFMKCb (ORCPT ); Mon, 13 Jun 2022 06:02:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD4F710A7; Mon, 13 Jun 2022 03:02:28 -0700 (PDT) Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LM6Tf4bCNz682DK; Mon, 13 Jun 2022 17:58:46 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml738-chm.china.huawei.com (10.206.15.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 12:02:26 +0200 Received: from [10.195.33.253] (10.195.33.253) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 11:02:25 +0100 Message-ID: <5a2047e3-5e71-141a-ec3a-2e22749d3c49@huawei.com> Date: Mon, 13 Jun 2022 11:05:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH RFC v2 03/18] scsi: core: Implement reserved command handling To: Damien Le Moal , , , , , , CC: , , , , References: <1654770559-101375-1-git-send-email-john.garry@huawei.com> <1654770559-101375-4-git-send-email-john.garry@huawei.com> <7f80f3b6-84f6-de48-4e69-4562c96e62c5@huawei.com> <53fa2856-54f2-c075-2eed-4f05c3459597@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.195.33.253] X-ClientProxiedBy: lhreml746-chm.china.huawei.com (10.201.108.196) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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 13/06/2022 10:43, Damien Le Moal wrote: >>> Currently, that is not possible to do cleanly as there are no guarantees >>> we can get a free tag (there is a race between block layer tag allocation >>> and libata internal tag counting). So a reserved tag for that would be >>> nice. We would end up with 31 IO tags at most + 1 reserved tag for NCQ >>> commands + ATA_TAG_INTERNAL for non-NCQ. That last one would be rendered >>> rather useless. But that also means that we kind-of go back to the days >>> when Linux showed ATA drives max QD of 31... >> So must the ATA_TAG_INTERNAL qc always be available for non-NCQ action >> like EH, and that is why you cannot reuse for this internal NCQ >> (queuable) command? > Currently, ATA_TAG_INTERNAL is always used for non-NCQ commands. Seeing a > qc with that tag means it is*not* NCQ. > > I am trying to see if I can reuse the tag from one of the commands that > completed with that weird good status/sense data available. The problem > though is that this all needs to be done*before* calling > qc->complete_fn() which will free the tag. So we endup with 2 qcs that > have the same tag, the second one (for the read log command) temporarily > using the tag but still going through the same completion path without the > original command fully completed yet. It is a real mess. > Reusing tags seems really messy, but then reserving an NCQ command seems wasteful. Thanks, John