Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5064291pxb; Mon, 15 Feb 2021 08:34:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzTImcyMz8XOpX/Rs3K/k8y6oNcnVeCgqRBUcVg5LnqSh66oMMDdkIz7UbucFnmTn3zKUA X-Received: by 2002:a17:907:da3:: with SMTP id go35mr15825288ejc.26.1613406852417; Mon, 15 Feb 2021 08:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613406852; cv=none; d=google.com; s=arc-20160816; b=Wdy6T0hGWsFS2azjMCXGTZjhpVATqnHGv4gvchIOoSY8xbry/mYr0H96f7mnoaxrQq 7QJGzPDk6+0IgeZswrMG9A+ICFrUceh5FaU9zEV5jwFZh3H6vaJAyWrj+lh/zL8V683r ZgxnHNEc8n8A5xpqKdDCsRfDgKpylQYny53ehXviPVZR8zsIMiJU+KkraIGsNyQIWTeL mvnS67sSOLn88yikRqBZ0sVDAbsTGrNloR79cPghQXJe5y11GdR/8rK9cveRqhXRUtYh nMMh8WSJfPSnUjoL4NP/rbG1lYKr6M5KI4KIXmFCr4vKuKbhe4Y6zHr1EE5Ekbo07s+q vQRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XFEQTQL/mfi7NTZNYBzDO0NY3pzQdJgxMc+GuyQ/zNo=; b=gd2AtRq2qhieTkxNXIAQarkJOSIALiM6dkSuRTP5SKkFo+eG5x0zQzCP/1sjfYzYQv ZmeXFWccy5Z54QQfyZUN5Ln7HDTziKSESJFq7Tryj8NMrJcXOJRwEKNekxD0C2NMcjxW dgS5kWC5QnitpHDjWSTecxEIBUA4OQYW/f+RkXfFbRk4RDI0HxFhcngqeqcomRhszlki Eo3sfCVvo2MWAV0XgVj0PqDx1CGz1TcuguX7P1YR/WVe7WA5AFrcVnijkFeFGDcegjlM qfbVrIDqGbnQX4o089LqcdjgFlkO1s1bDUoPR2c0mF02nVwD0zVgHkaNGmWDLhY8VnKr JWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ijhbXGzH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si3070654eja.338.2021.02.15.08.33.48; Mon, 15 Feb 2021 08:34:12 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ijhbXGzH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbhBOQc6 (ORCPT + 99 others); Mon, 15 Feb 2021 11:32:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:50360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbhBOPhk (ORCPT ); Mon, 15 Feb 2021 10:37:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 371EF64E34; Mon, 15 Feb 2021 15:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403172; bh=xS1Pt+PYfKUTxEyXn4PYk1P4+dKudPioyWkc7c3XnTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijhbXGzHvVg6T+qF3n8gekTuJeZMpY3dhkrxDXU0z+WN8XLAijrfdT+TQ9/7T7dw3 lAp6l3EAYQW4wZxWNktfEJfXVCVttKhivZIUXkejeiPTERNPkimgjKmHYvUBCyyOeg EZ6w9UNQm+Jpk9HuSJqf0t4miQ3sTTcFEtjrHGGk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lin Feng , Jan Kara , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 038/104] bfq-iosched: Revert "bfq: Fix computation of shallow depth" Date: Mon, 15 Feb 2021 16:26:51 +0100 Message-Id: <20210215152720.711381389@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lin Feng [ Upstream commit 388c705b95f23f317fa43e6abf9ff07b583b721a ] 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. Signed-off-by: Lin Feng Reviewed-by: Jan Kara Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 9e4eb0fc1c16e..9e81d1052091f 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++) -- 2.27.0