Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3624906pxb; Sun, 31 Jan 2021 23:36:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUu6DfwmhuvSqAd0wWokBLHPv1eIOAnRijnVoOc+B1pZ6MPyk+u7VsdCqyjjg5JEhn9gT5 X-Received: by 2002:a17:906:442:: with SMTP id e2mr10790380eja.9.1612164970922; Sun, 31 Jan 2021 23:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612164970; cv=none; d=google.com; s=arc-20160816; b=PwiUBE+CQ3NvDYFJr5DI1s7oAM2oqBoeQnF/7JlkCshQ2fOtw0tpnIhX4EWNpgf8xc HES1qTztETk8mnwss9f46yRmdQ7DMAL/7pDzSWWrySIYDgue3F7qYtBr4lPnxvDHQxXi mOtBM8GUV7QwArellibJffM+bS3q4sH5dW47qE0ZcDIj2YTqB10dbqJ9iA9uTWIZxjk8 OLUf6fB/XiKLdbA1emRkUZEX15vp2rNhhiZ9LK4Ro4fGBXFm72zVoeCNSRxIC0L7gFC9 hZuvUf0wBpfBOUqEJlTAOv4KwkkDHLEbpcQckkPyFNV1dMAKbFOs8wAuXpFPmUqxQt2H eLGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4K74HQg0vKqHFDrJopRUrFV3/r5ZnEq5kecTdc6L8MU=; b=FC7IfxfoFGQxGxzcGhbRQXR4S80oF/DpcAMV1PXO3A+ZrEk48b1QPHD7Y0O0jzg4th 5McXvWtAl9wnFOEDeuEPwEg1qRSNXzz29lOY8AmME0UnbAg3ZJlYcgIN8LxJ9xJ+SdFk l2dpvGRZfjZD3SOywF6y+tDo1VpBWlXrXlO8AxjcdtZ2s04IH6Vz+le+F36IAo+5ZHz0 fROe4hKexR2+6/hwXPROAmhqOWarNGmgcCnWijIl9/T8se7C0O8FZeRrrVIluryZsFEs 5RRpxfYYTFuYi7kk2r1xh/YPF78i35CAcKDAMPMSqeYkcWxt8PZMPYbQViUusWi7+OJD t6aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wangsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si10781780ejs.13.2021.01.31.23.35.46; Sun, 31 Jan 2021 23:36:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wangsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231740AbhBAHef (ORCPT + 99 others); Mon, 1 Feb 2021 02:34:35 -0500 Received: from mail.wangsu.com ([123.103.51.227]:51174 "EHLO wangsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229736AbhBAHed (ORCPT ); Mon, 1 Feb 2021 02:34:33 -0500 Received: from [10.8.148.37] (unknown [59.61.78.237]) by app2 (Coremail) with SMTP id 4zNnewCXP++NrhdgcaYBAA--.753S2; Mon, 01 Feb 2021 15:32:29 +0800 (CST) Subject: Re: [PATCH] Revert "bfq: Fix computation of shallow depth" To: axboe@kernel.dk, paolo.valente@linaro.org, jack@suse.cz Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org References: <20210129111808.45796-1-linf@wangsu.com> From: Lin Feng Message-ID: <749df7e1-98b5-a575-506d-a7c7c4d96a6f@wangsu.com> Date: Mon, 1 Feb 2021 15:32:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20210129111808.45796-1-linf@wangsu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID: 4zNnewCXP++NrhdgcaYBAA--.753S2 X-Coremail-Antispam: 1UD129KBjvJXoWxCw43uw1DJry8KFW8JFW7CFg_yoW5ArWUp3 W3Kr13Kr4xtF429r1UAryxWryF9wn5JrySgF1aqw18CrW8XFn7XF95KFnYvFnrurs7AF40 vry5Wr98W3ZYqFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkqb7Iv0xC_Kw4lb4IE77IF4wAFc2x0x2IEx4CE42xK8VAvwI8I cIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjx v20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26rxl6s0DM28EF7xvwVC2 z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcV Aq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x8ErcxFaVAv8VW8GwAv 7VCY1x0262k0Y48FwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMx k0xIA0c2IEe2xFo4CEbIxvr21lc2xSY4AK67AK6r4xMxAIw28IcxkI7VAKI48JMxAIw28I cVCjz48v1sIEY20_Gr4l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJV WUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAK I48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r 4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IUe3Ef5UUUUU== X-CM-SenderInfo: holqwq5zdqw23xof0z/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, it seems that this patch was blocked by linux mailist servers, so ping again. Based on https://patchwork.kernel.org/project/linux-block/patch/20201210094433.25491-1-jack@suse.cz/, it looks like we have made a consensus about bfqd->word_depths[2][2]'s changing, so now the computation codes for bfq's word_depths array are not necessary and one variable is enough. But IMHO async depth limitation for slow drivers is essential, which is what we always did in cfq age. On 1/29/21 19:18, Lin Feng wrote: > This reverts commit 6d4d273588378c65915acaf7b2ee74e9dd9c130a. > > bfq.limit_depth passes word_depths[] as shallow_depth down to sbitmap core > sbitmap_get_shallow, which uses just the number to limit the scan depth of > each bitmap word, formula: > scan_percentage_for_each_word = shallow_depth / (1 << sbimap->shift) * 100% > > That means the comments's percentiles 50%, 75%, 18%, 37% of bfq are correct. > But after commit patch 'bfq: Fix computation of shallow depth', we use > sbitmap.depth instead, as a example in following case: > > sbitmap.depth = 256, map_nr = 4, shift = 6; sbitmap_word.depth = 64. > The resulsts of computed bfqd->word_depths[] are {128, 192, 48, 96}, and > three of the numbers exceed core dirver's 'sbitmap_word.depth=64' limit > nothing. Do we really don't want limit depth for such workloads, or we > just want to bump up the percentiles to 100%? > > Please correct me if I miss something, thanks. > > Signed-off-by: Lin Feng > --- > block/bfq-iosched.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c > index 9e4eb0fc1c16..9e81d1052091 100644 > --- a/block/bfq-iosched.c > +++ b/block/bfq-iosched.c > @@ -6332,13 +6332,13 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, > * limit 'something'. > */ > /* no more than 50% of tags for async I/O */ > - bfqd->word_depths[0][0] = max(bt->sb.depth >> 1, 1U); > + bfqd->word_depths[0][0] = max((1U << bt->sb.shift) >> 1, 1U); > /* > * no more than 75% of tags for sync writes (25% extra tags > * w.r.t. async I/O, to prevent async I/O from starving sync > * writes) > */ > - bfqd->word_depths[0][1] = max((bt->sb.depth * 3) >> 2, 1U); > + bfqd->word_depths[0][1] = max(((1U << bt->sb.shift) * 3) >> 2, 1U); > > /* > * In-word depths in case some bfq_queue is being weight- > @@ -6348,9 +6348,9 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, > * shortage. > */ > /* no more than ~18% of tags for async I/O */ > - bfqd->word_depths[1][0] = max((bt->sb.depth * 3) >> 4, 1U); > + bfqd->word_depths[1][0] = max(((1U << bt->sb.shift) * 3) >> 4, 1U); > /* no more than ~37% of tags for sync writes (~20% extra tags) */ > - bfqd->word_depths[1][1] = max((bt->sb.depth * 6) >> 4, 1U); > + bfqd->word_depths[1][1] = max(((1U << bt->sb.shift) * 6) >> 4, 1U); > > for (i = 0; i < 2; i++) > for (j = 0; j < 2; j++) >