Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1056473rda; Mon, 23 Oct 2023 00:27:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLRyI653pWg+eTZoLxOyi+E4zVWtsMBx81KheaTmZTwCw76vaqp9aTvsh64Iae5VvTuI5y X-Received: by 2002:a05:6359:6006:b0:168:e589:6494 with SMTP id rw6-20020a056359600600b00168e5896494mr684126rwb.24.1698046028918; Mon, 23 Oct 2023 00:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698046028; cv=none; d=google.com; s=arc-20160816; b=MsCK87/LFGCmiVHKOiTj0GDbeaYyZdHKSgDVc6V+RLkg1jlPVIG5aMHAJ8LFJ8kWDZ fVKyJHyhb4yWyOwm5CX+K9w4JgPO27C7ugzjnCEPqTbFBXenWox+mgaGF/b0hbAMz9uw xWahivbgP+TGNBUh7QxqjwmttKeyrWKUzH4sIC9ehuD7tOJXNsg0mWPoQd5trHW3vVPN m9bmSSnmlzfsHHDIXCUyr92aQmbiLfi/tjAjVcvYKnLbFTDREL9oa+6m5iFNVE1yxCV+ Nh0jHG2GDoTAGBsH3gcDytlBSQaaYCOxlLGIeupGhZ07Q4YwU6cpv8XEEui76J6E0a6X AztQ== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=qEeqW8HOAsDXlX8E5CLisOVvLwbO6Nz/guyos0HX7RA=; fh=Vno7ByXYBYVxmhDdaGA003mvjWBzVteM8EuKNyrhAc8=; b=Ad2Sb/1Fa266GtHdl+KMLwdgZUcmdjDgBCOf+nv1tqo9v5A1vB8aBfgQC5qOB4YVtg Cz/G5Zp+wprptvfPGrwwv6aO9A2RFOrEWsAd/rhsOYrl51mgzA0z+WFrHhrlyZqSv9ns kifK5iQuucUqbAZAK51LBK5anMC5kxaA8HoVYEskWw5KrtsmUXixLnZRZ49PZN6srd7V O+/jTOZvftuMx8YACL+iMnELWSw8CmQ3FyjmD4QVihEQrzEkNVh0/Wh/y4zS01YDyj/K xwtud2VWbA9FMsw7nefd7rTwy4dU8ik663hr38lj6H8k7eTeJ9GUMVMiPKrNj2OY0+Pe dGfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id p16-20020a631e50000000b0057821ea0674si6179668pgm.812.2023.10.23.00.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 00:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 515BD805000A; Mon, 23 Oct 2023 00:27:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233453AbjJWH0y (ORCPT + 99 others); Mon, 23 Oct 2023 03:26:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJWH0x (ORCPT ); Mon, 23 Oct 2023 03:26:53 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB739D6; Mon, 23 Oct 2023 00:26:50 -0700 (PDT) Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4SDRZm4TV8z4f3kGC; Mon, 23 Oct 2023 15:26:40 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 5DA941A0171; Mon, 23 Oct 2023 15:26:46 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP4 (Coremail) with SMTP id gCh0CgBn+dg0IDZlt0TeDg--.38637S3; Mon, 23 Oct 2023 15:26:46 +0800 (CST) Subject: Re: [PATCH RFC v2 0/8] blk-mq: improve tag fair sharing To: Ming Lei , Yu Kuai Cc: bvanassche@acm.org, hch@lst.de, kbusch@kernel.org, axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" References: <20231021154806.4019417-1-yukuai1@huaweicloud.com> From: Yu Kuai Message-ID: <40652bee-4086-1b32-b840-1f9a3adfe358@huaweicloud.com> Date: Mon, 23 Oct 2023 15:26:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBn+dg0IDZlt0TeDg--.38637S3 X-Coremail-Antispam: 1UD129KBjvJXoW7CrW5Cw1rXFWUWw47KFWfXwb_yoW8WF47pF WSqF47tws2vw42kFWDX39xGFyfKr4kGry5Kr97G347Zws8urnagr4xtr45uFZ7AF1DGrWU urWq9rZ8CFyDX3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9F14x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gc CE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka 0xkIwI1lc7I2V7IY0VAS07AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7x kEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E 67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCw CI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E 3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcS sGvfC2KfnxnUUI43ZEXa7VUbXdbUUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 23 Oct 2023 00:27:06 -0700 (PDT) Hi, ?? 2023/10/23 12:38, Ming Lei ะด??: > Hello Yu Kuai, > > On Sat, Oct 21, 2023 at 11:47:58PM +0800, Yu Kuai wrote: >> From: Yu Kuai >> >> Current implementation: >> - a counter active_queues record how many queue/hctx is sharing tags, >> and it's updated while issue new IO, and cleared in >> blk_mq_timeout_work(). >> - if active_queues is more than 1, then tags is fair shared to each >> node; > > Can you explain a bit what the problem is in current tag sharing? > And what is your basic approach for this problem? > > Just mentioning the implementation is not too helpful for initial > review, cause the problem and approach(correctness) need to be > understood first. Of course, I'll add following if there will be a v3; Current problems: If there are multiple active_queues, then tag is fair shared to each queue, and if one queue is not busy(for example, only issue one IO once for a while), then shared tags for this queue is wasted and can't be used for other queues. Depends on the hardware, this might casue performance problems in some user case. For example, as reported by [1], UFS devices have multiple logical units. One of these logical units (WLUN) is used to submit control commands, e.g. START STOP UNIT. If any request is submitted to the WLUN, the queue depth is reduced from 31 to 15 or lower for data LUNs. This patchset first delay tag sharing from issue IO to failed to get driver tag; then add a counter to record how many times shared queue failed to get driver tag to indicate if the queue is busy; finially, allow busy queue to borrow more tags from idle queue. Thanks, Kuai > > Thanks, > Ming > > . >