Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1500919pxb; Wed, 30 Mar 2022 05:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4ctHSkkRm9Rautdjg3qXgyS6vAPn8vT1xAdWaAOF9nCL5l4wecqtbObmLA31by9qArD9z X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr35175544plr.31.1648642077702; Wed, 30 Mar 2022 05:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648642077; cv=none; d=google.com; s=arc-20160816; b=QXYJ1RkrdK5wrR0ju1/fsA9Y1a0O2aWMlOhCiPEgQJEGYALclsrDlCVzeW99GvzAS3 YYa/sA+vAunLmJztbaxidX2KiFC3iAEFunrxcMT89aNz6d0tA1fI+w7aLNhuo77A8T0C HNqADGXYMWGk4fZ4Ee0crzHLzZWUyXdVyNmpT+gHQhgEAKFAcY73hQ9sK9IrRaW9/DRX /WUKCk1w/OqstqQvKvFZtopNNgpTjKD5NM8JrljS9Ng0A5JDfcpCYe+Qt7kHyJdutcTS HKF8/mBYn3imf/Ao9OOI7KrcCHYS8GzEbK+BWFjrrR3fI23mpE6/zDvq93yZW5YfGFMW ODPg== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=H+yRyS1d98IcrBQFZB9iiSX2T4SDFA0//etts+xx4xA=; b=I7A0JONgZG4cSSmoFu1FCAwASMyyk/po2if83MVBZ2RRekUc4fiBQNr84uAmVqUBTN +00Lif+wMYl7gSBcyECumHVlaOkrNUp+Mb1TYxbEh+QfoFpR06qQqrN8qHVX9Xr+7Gpx eRvTjr/p2aeZxPal6Lgkv6Qjw23yRSYlcFJUrRKtjbfzQ9jOrdVnNKTWZ7s8VZH/68YC V7Lb3iCUDceORRQkaQWtnh+uWhlDRyDfsY6Aq1QeRnBP6TY0SppxXVkbMfl73dJYsDt+ GzLdQE01a9TZ4yR3PhSeAju5O8yf7g4RJINBXrdpo4HYD4stgapbnnJlaKhL3MeeJahC cFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=1pslRGrN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a63f752000000b00398a0c97c69si2895880pgk.751.2022.03.30.05.07.44; Wed, 30 Mar 2022 05:07:57 -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; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=1pslRGrN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237029AbiC2M5K (ORCPT + 99 others); Tue, 29 Mar 2022 08:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237045AbiC2M4u (ORCPT ); Tue, 29 Mar 2022 08:56:50 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3A175A0AE for ; Tue, 29 Mar 2022 05:53:45 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id j13so17531402plj.8 for ; Tue, 29 Mar 2022 05:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=H+yRyS1d98IcrBQFZB9iiSX2T4SDFA0//etts+xx4xA=; b=1pslRGrN6XglfZNraIDgwb+dTS7GLxRkQPZso9STUANxT6OprvFvoXCs5iZNULpR+X amHu9WaFS3xEGBVG+qwC1n7q2SOLW1qXN4uKS0gPJiWtH5bbuHalsJO9KyAv5GMzRmRT WwWlDk3b5j8H3ktTMVhPx7RxJqyNOqGzv30XJPiMBXhljWX3fsk40rvcHardjHedTUyK tXJjoRd53F/qbrbOHJrcr2ArcRtahOEeQDvSQVejEOQzxE59PylUdAPyhRLD0JqW2kmz cpfacwGZu5igPX9MWCW+vuY6aI46qjOswKbR/AmoLN4yE+SnQ2+HJrcwDq9cd9hZC0eG c11A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=H+yRyS1d98IcrBQFZB9iiSX2T4SDFA0//etts+xx4xA=; b=GaYPYPqOXF8cNUUyFQbLcJJqAliIiL/HCOH4S0A2BQLi24uuOUfLgN0pN8Sgrf3JLY WBzOZb+3jsW3Z6R2V3ETe2UPhvw+aA+NM0bB/FAwkgJms9pdR4YNn2dPtsH/bxKFtlC1 VL7eeafp7k+P+6zKKwG5HfncKaGtW3YzVtKw6DqwhEDunbJl6ujO3bQOiUz70jqleT6p F8Vh7cDmhGEavioxxmTQDybUKT1YR3ahNl4l+xUD+msabSCrjRzshw5fgqPJd+HDEpWO WoZie9mVt0Xy609jQF+QOja9f4XQn4WAqA0127BmKtAxtaygo+UeyvGScCfRh9qCh1PC QH0g== X-Gm-Message-State: AOAM532bL9kgoJpdJDohnSI7qS/f0VVfTbDS+GTXeH6kLUCqsRuXP1o0 kUFMg0zdnnZQH0c2XFnOMmw6Qg== X-Received: by 2002:a17:902:f70f:b0:153:ebfe:21b3 with SMTP id h15-20020a170902f70f00b00153ebfe21b3mr30462409plo.119.1648558425372; Tue, 29 Mar 2022 05:53:45 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id n4-20020a637204000000b00398522203a2sm5730641pgc.80.2022.03.29.05.53.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Mar 2022 05:53:44 -0700 (PDT) Message-ID: Date: Tue, 29 Mar 2022 06:53:43 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH -next RFC 0/6] improve large random io for HDD Content-Language: en-US To: Yu Kuai , andriy.shevchenko@linux.intel.com, john.garry@huawei.com, ming.lei@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com References: <20220329094048.2107094-1-yukuai3@huawei.com> From: Jens Axboe In-Reply-To: <20220329094048.2107094-1-yukuai3@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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. -- Jens Axboe