From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0459EC433E1 for ; Tue, 4 Aug 2020 17:03:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E97AE207FC for ; Tue, 4 Aug 2020 17:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728880AbgHDRDm (ORCPT ); Tue, 4 Aug 2020 13:03:42 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2566 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726925AbgHDRDf (ORCPT ); Tue, 4 Aug 2020 13:03:35 -0400 Received: from lhreml724-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 8CEB3D9EE9533AB18F25; Tue, 4 Aug 2020 18:02:58 +0100 (IST) Received: from [127.0.0.1] (10.47.11.189) 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.1913.5; Tue, 4 Aug 2020 18:02:57 +0100 Subject: Re: [PATCH RFC v7 10/12] megaraid_sas: switch fusion adapters to MQ To: Ming Lei CC: Kashyap Desai , , , , , Sumit Saxena , , , , Shivasharan Srikanteshwara , , , , , "PDL,MEGARAIDLINUX" References: <20200721011323.GA833377@T590> <20200722041201.GA912316@T590> <20200722080409.GB912316@T590> <20200723140758.GA957464@T590> <20200724024704.GB957464@T590> <6531e06c-9ce2-73e6-46fc-8e97400f07b2@huawei.com> <20200728084511.GA1326626@T590> From: John Garry Message-ID: <0610dce9-a5d0-ebb8-757f-0c7026891e25@huawei.com> Date: Tue, 4 Aug 2020 18:00:52 +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: <20200728084511.GA1326626@T590> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.11.189] X-ClientProxiedBy: lhreml720-chm.china.huawei.com (10.201.108.71) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 28/07/2020 09:45, Ming Lei wrote: >> OK, so dynamically allocating the sbitmap could be good. I was thinking >> previously that we still allocate for nr_cpus size, and search a limited >> range - but this would have heavier runtime overhead. >> >> So if you really think that this may have some value, then let me know, so >> we can look to take it forward. Hi Ming, > Forget to mention, the in-tree code has been this shape for long > time, please see sbitmap_resize() called from blk_mq_map_swqueue(). So after the resize, even if we are only checking a single word and a few bits within that word, we still need 2x 64b loads - 1x for .word and 1x for .cleared. Seems a bit inefficient for caching when we have a 1:1 mapping or similar. For 1:1 case only, how about a ctx_map per queue for all hctx, with a single bit per hctx? I do realize that it makes the code more complicated, but it could be more efficient. Another thing to consider is that for ctx_map, we don't do deferred bit clear, so we don't ever really need to check .cleared there. I think. Thanks, John