Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2483128ybb; Mon, 30 Mar 2020 07:04:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsjnGGuxENv7jdnuYkUkhLxbKM9DuTheQ4aXOkDodm/ckTLRij21q4EQ03Lrw3PqIz1Gs+9 X-Received: by 2002:aca:d44d:: with SMTP id l74mr7757256oig.83.1585577088087; Mon, 30 Mar 2020 07:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585577088; cv=none; d=google.com; s=arc-20160816; b=KwJVjjEuxVDaLQeu0cVmQHxWXsbTOarcXT4j0TLhZ/jd5z+A0ufMoR+j3/lfJVS2dD mNO78Cq55pwxmri+xVMQdEtgqvmnUKNjAlMJwv2N5/H2wK1/Aa9BlciatMiMJmG+Ijtz 4xpTMpnkGEAWLzWFg/+2RafdSkkaS231FpadEj+Jd/srMnz2Z6cq74Az/kKEOAAnlDOS l+C9KyScyvoTF7sJefKdWh04OOzRsnKA90dQ7wDaxo6E2Nuyv9+57ZmswuQWKUXl0mvb xOavT+ztS/7dSS1RarWv++7xebA+ejnsRgfYQNJpKg5pUpyBCufzL/keV/tuqY2pqTBS 60WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ILVpVEkYVrl0j7VmdrruQxwu0cgGV9s+eGWghDDAsM4=; b=rZbt4WjAVPbaS/RmjNJ5NDybabfdt16YLEee2J/BFd15/MLI+KUfwNSPDyEMK8FShZ 0OjtfuHvTaK0bOtvKd7MqKyhWtP2u6fXupDF1UgzVmvhIoH5gIz7j2kAQmh83zcTK1OI z9vgm93rkisZX9vyYXLqseYtgluXYKOXp31lEbBaJEksozAnsbPsbZ0BU8YB0O/Ya+et P+WCTVpnozQl/apBJ18hgymuLQA2NlVgWTzjzJpwfU2Wm2xc4QxzZB1O8mISE+ONqbdP xz8PJEAEeq25yKevY2sUFCxVzLMhLycT5mS2cZfe5vWYmVCFo92EocfRQVgAF9G27xrM gsJw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si6263787oib.135.2020.03.30.07.04.30; Mon, 30 Mar 2020 07:04: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728334AbgC3NnF (ORCPT + 99 others); Mon, 30 Mar 2020 09:43:05 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2617 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728301AbgC3NnE (ORCPT ); Mon, 30 Mar 2020 09:43:04 -0400 Received: from lhreml724-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 4BE4F118960F3A97A5F9; Mon, 30 Mar 2020 14:43:03 +0100 (IST) Received: from [127.0.0.1] (10.47.8.155) 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.1713.5; Mon, 30 Mar 2020 14:43:01 +0100 Subject: Re: [PATCH RFC v2 12/24] hpsa: use reserved commands To: Hannes Reinecke , Ming Lei CC: , , , , , , , , , , , Hannes Reinecke References: <1583857550-12049-1-git-send-email-john.garry@huawei.com> <1583857550-12049-13-git-send-email-john.garry@huawei.com> <20200311081059.GC31504@ming.t460p> <881b6a9b-2137-946f-a900-5c4e6cf1fe37@suse.de> From: John Garry Message-ID: Date: Mon, 30 Mar 2020 14:42:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <881b6a9b-2137-946f-a900-5c4e6cf1fe37@suse.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.8.155] X-ClientProxiedBy: lhreml727-chm.china.huawei.com (10.201.108.78) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/03/2020 09:48, Hannes Reinecke wrote: > On 3/17/20 10:38 AM, John Garry wrote: >> On 11/03/2020 08:10, Ming Lei wrote: >>>> ands(struct ctlr_info *h) >>>> @@ -5803,6 +5803,7 @@ static int hpsa_scsi_host_alloc(struct >>>> ctlr_info *h) >>>>       sh->max_lun = HPSA_MAX_LUN; >>>>       sh->max_id = HPSA_MAX_LUN; >>>>       sh->can_queue = h->nr_cmds - HPSA_NRESERVED_CMDS; >>>> +    sh->nr_reserved_cmds = HPSA_NRESERVED_CMDS; >>> Now .nr_reserved_cmds has been passed to blk-mq, you need to increase >>> sh->can_queue to h->nr_cmds, because .can_queue is the whole queue depth >>> (include the part of reserved tags), otherwise, IO tags will be >>> decreased. >>> >> >> Sounds correct. >> > I will have having a look at the patchset; I thought I did a patch to > modify .can_queue so that it would cover only the usable tags, not the > reserved ones. > To me, it makes sense to leave .can_queue unmodified, carry it down to blk-mq and allow blk_mq_init_bitmap_tags() find the queue depth: static struct blk_mq_tags *blk_mq_init_bitmap_tags(struct blk_mq_tags *tags, int node, int alloc_policy) { unsigned int depth = tags->nr_tags - tags->nr_reserved_tags; * bool round_robin = alloc_policy == BLK_TAG_ALLOC_RR; if (bt_alloc(&tags->bitmap_tags, depth, round_robin, node)) goto free_tags; Cheers, John