Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2219303pxb; Wed, 30 Mar 2022 19:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVpY5/HR7hXGErRX25YRhTlKqJR6AsetEeWwXUGFuzSNyOhhQthfbuT7naKpITNFRk90SG X-Received: by 2002:a63:d90f:0:b0:385:f726:800f with SMTP id r15-20020a63d90f000000b00385f726800fmr8708096pgg.418.1648694598764; Wed, 30 Mar 2022 19:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648694598; cv=none; d=google.com; s=arc-20160816; b=WCetomVfgwwSLDyIiICMFbxxK84buvqImVpYmUf6H6XcvV4LqE3EAN3m+e0eoyMhQh eERDXj7IP4qq5xXB2OzR69Md/e5h+FdEkB5Yq60b9DyPtz5ogOm5Ca+Nv1pixDQjp8TO 436pHndbDyv1liOp4ZvX9J/jmt5Q1E/EKzZowkxKkrm/jWmBWV57Cmah78e6yZV0e0hR in/aiBu4X/Kc9LF3HmsaA/c9U+JBdSFSOQlCZR5lYAu4d62dcTLxeboKlZDgzyC+oMYe k3SzkmvRxZtzqq7WcUEpMUtpPvccIX0+H6UDxnQVWWinwqBdxEOLBNGn04NZvXw665oI 29uQ== 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=Z4NB8/cuP4VgLl3Vns9Uj5XRE534rNA7gJTT+YKayf4=; b=AhEcuzS3aCWU5j2klQG+k6UdtqzxjdBY8+vPCpqF/HP0KfiYo93LXqM2APtu0by4jX hdMBEr+n+97o/TJojod9zcEwKSyoBiWppfJtEHYS+g+fHb7wqNTxsRsrghTyLJT2Sw6V 11WFZDni2Vh8j2vtNPTIkhPI7Da+11vODIhBe1ZFJVoa6HRiU6fNXdfCZAZTnBrCGvDg FElBb7nZNcAlNLsbqh847OhWdaYvOS0ypt+et7YCqB23HY0WdNquTLFESPd/1spn/r5O FF+uEOWtGVc05hm67WQ29BuoM/WrX9E+n2QwnAjTceXD9Z7Wkj6peDxi/qzNI/YT2lAv Osww== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b25-20020a631b59000000b0039846ac15b5si15603515pgm.284.2022.03.30.19.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C675DA88A4; Wed, 30 Mar 2022 19:34:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241937AbiC3CIo (ORCPT + 99 others); Tue, 29 Mar 2022 22:08:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242006AbiC3CIB (ORCPT ); Tue, 29 Mar 2022 22:08:01 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3AD6B820F; Tue, 29 Mar 2022 19:06:17 -0700 (PDT) Received: from kwepemi500009.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KSqV60h5RzDq6w; Wed, 30 Mar 2022 10:03:42 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi500009.china.huawei.com (7.221.188.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 30 Mar 2022 10:05:54 +0800 Received: from [10.174.176.73] (10.174.176.73) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 30 Mar 2022 10:05:54 +0800 Subject: Re: [PATCH -next RFC 0/6] improve large random io for HDD To: Jens Axboe , , , CC: , , References: <20220329094048.2107094-1-yukuai3@huawei.com> From: "yukuai (C)" Message-ID: <7dec80e4-b96c-f00e-10c0-8510efa4b572@huawei.com> Date: Wed, 30 Mar 2022 10:05:53 +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="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.73] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 在 2022/03/29 20:53, Jens Axboe 写道: > On 3/29/22 3:40 AM, Yu Kuai wrote: >> There is a defect for blk-mq compare to blk-sq, specifically split io >> will end up discontinuous if the device is under high io pressure, while >> split io will still be continuous in sq, this is because: >> >> 1) split bio is issued one by one, if one bio can't get tag, it will go >> to wail. - patch 2 >> 2) each time 8(or wake batch) requests is done, 8 waiters will be woken up. >> Thus if a thread is woken up, it will unlikey to get multiple tags. >> - patch 3,4 >> 3) new io can preempt tag even if there are lots of threads waiting for >> tags. - patch 5 >> >> Test environment: >> x86 vm, nr_requests is set to 64, queue_depth is set to 32 and >> max_sectors_kb is set to 128. >> >> I haven't tested this patchset on physical machine yet, I'll try later >> if anyone thinks this approch is meaningful. > > A real machine test would definitely be a requirement. What real world > uses cases is this solving? These days most devices have plenty of tags, > and I would not really expect tag starvation to be much of a concern. > > However, I do think there's merrit in fixing the unfairness we have > here. But not at the cost of all of this. Why not just simply enforce > more strict ordering of tag allocations? If someone is waiting, you get > to wait too. > > And I don't see much utility at all in tracking how many splits (and > hence tags) would be required. Is this really a common issue, tons of > splits and needing many tags? Why not just enforce the strict ordering > as mentioned above, not allowing new allocators to get a tag if others > are waiting, but perhaps allow someone submitting a string of splits to > indeed keep allocating. > > Yes, it'll be less efficient to still wake one-by-one, but honestly do > we really care about that? If you're stalled on waiting for other IO to > finish and release a tag, that isn't very efficient to begin with and > doesn't seem like a case worth optimizing for me. > Hi, Thanks for your adivce, I'll do more work based on your suggestions. Kuai