Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1993114rwi; Fri, 28 Oct 2022 01:23:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QGPOydGdJCbY3yo1c998U3i8DDzDk8Y8Cb58U/edRUBbfDCtY0mPsJSDChWoREr9IREMP X-Received: by 2002:a17:906:fe45:b0:791:9624:9e9f with SMTP id wz5-20020a170906fe4500b0079196249e9fmr46228206ejb.86.1666945420097; Fri, 28 Oct 2022 01:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666945420; cv=none; d=google.com; s=arc-20160816; b=yFUNek5EVPN/3oAO2cUXnVqT9D0FbfScjg0Gs/MUGwEytXIb4Y4GrQx3n+VLxX3OZ5 3zcbRidXByzJnk8nS9PZtzvP8set3UUKUyXwlp2LUs727EoNGahOVK+sIIh9bpHsacQi zCac85CQGLYEM9BhOb90S4xafn0PHebvFdINP7r8psa+l7HWLCqpsiNgstgxQcsbiKRJ GXMp7W78PB3ew11SYwaZgvPQHGaJm/k5GCE6KnOSNpoTzLcpgubprevaFpwqfuFJiuzy aNx7xjcVd16f8VqM3BzTf4Sv9Aw+ZfKLuoJ5QLvaLzEjeBx6grlzcogJlcJ5vmml9myU f3lQ== 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=wOctDBdX3ZePwUzeexiPDuWRNUo4GFFVupX6K3pwb28=; b=qyipo5gK7xZRcdNaKrpND0LQh5wlo7V76kAz6Q+NgOiF7N3Mqs16BukHzt4nAPM1Ln 9iNIXCO9xgfeAaHF50vLpv1I+wJgbV3XTcyhHxv73mjhn0JPYxWgdShsIbPU2+d3IKom kdJ/WMQpkq7MtwZj8CMRNPcqKIBOY7IIewDk/NLKmYaHUbrs0cXAjV8xetok8E+Ynscw wyNpbw6IK7v0GoHaBiKot0RTGY1C7mQYl0LBYZ/XhiLcdCZ2NFklmHBG+wLc6pKKGOSM laHxVcFAZDe29MvIE8041QTPsYgQSNEPAVJlt4n/jmw3ZXRs74A3BnW3T+MoBghRqS0c UyXg== 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 dt2-20020a170907728200b0073d9c29892csi4530941ejc.939.2022.10.28.01.23.12; Fri, 28 Oct 2022 01:23:40 -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 S229683AbiJ1IBc (ORCPT + 99 others); Fri, 28 Oct 2022 04:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiJ1IBb (ORCPT ); Fri, 28 Oct 2022 04:01:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B5868CF9; Fri, 28 Oct 2022 01:01:30 -0700 (PDT) Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MzFJr5g2kz67Y4M; Fri, 28 Oct 2022 15:57:48 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 10:01:28 +0200 Received: from [10.48.144.136] (10.48.144.136) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 28 Oct 2022 09:01:27 +0100 Message-ID: <0e60fab5-8a76-9b7e-08cf-fb791e01ae08@huawei.com> Date: Fri, 28 Oct 2022 09:01:28 +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 v3 2/7] ata: libata-scsi: Add ata_internal_queuecommand() To: Damien Le Moal , , , , , , , CC: , , , , , , , References: <1666693976-181094-1-git-send-email-john.garry@huawei.com> <1666693976-181094-3-git-send-email-john.garry@huawei.com> <08fdb698-0df3-7bc8-e6af-7d13cc96acfa@opensource.wdc.com> <83d9dc82-ea37-4a3c-7e67-1c097f777767@huawei.com> <9a2f30cc-d0e9-b454-d7cd-1b0bd3cf0bb9@opensource.wdc.com> From: John Garry In-Reply-To: <9a2f30cc-d0e9-b454-d7cd-1b0bd3cf0bb9@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.144.136] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 27/10/2022 23:25, Damien Le Moal wrote: >> So we have this overall flow: >> >> ata_exec_internal_sg(): >> -> alloc request >> -> blk_execute_rq_nowait() >> ... -> scsi_queue_rq() >> -> sht->reserved_queuecommd() >> -> ata_internal_queuecommand() >> >> And then we have ata_internal_queuecommand() -> ata_sas_queuecmd() -> >> ata_scsi_queue_internal() -> ata_qc_issue(). >> >> Hope it makes sense. > OK. Got it. > However, ata_exec_internal_sg() being used only from EH context with the > queue quiesced, will blk_execute_rq_nowait() work ? Is there an exception > for internal reserved tags ? > Well, yeah. So if some error happens and EH kicks in, then full queue depth of requests may be allocated. I have seen this for NCQ error. So this is why I make in very first patch change allow us to allocate reserved request from sdev request queue even when budget is fully allocated. Please also note that for AHCI, I make reserved depth =1, while for SAS controllers it is greater. This means that in theory we could alloc > 1x reserved command for SATA disk, but I don't think it matters. Thanks, John