From patchwork Fri Jan 18 11:52:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 155921 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3163598jaa; Fri, 18 Jan 2019 03:52:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4T6xt/NmD3RLqEnA8l3gYrGGL4kFTc1dVK/0NQRDX2WdXRMDA7g6E9PLWT2sAyN6qmfxqi X-Received: by 2002:a62:104a:: with SMTP id y71mr161849pfi.34.1547812360159; Fri, 18 Jan 2019 03:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547812360; cv=none; d=google.com; s=arc-20160816; b=xTfgcePEGj53JxHJe5EDcY+/YRf00/v0yWzo4i7SYK0d+cRLm0FZYyzqaLeMbAfL+6 Qa1Zg2SPM/m4H5z2Nqfm36Vtk4ZaZmdVCrad/MOltFW7lVsnegXfJAZ45bh0J3U9/1RH 2fErjoPYNlECWSl8slIEuUEZvKjd41+KATfII4rGBI0RfMs0EUkCsSpCO/VeUpWxDtQ5 fCVV5BBMUc3iz7vqFPNVpzVZ4QsdS4dT61DGt5n+AyYS+WRCAPtJs3Zn6wDbovpD6D8N JfnR8kVtOVjSFgSrqJXMDgs9F6hamppfGRpx8iWZQwdyRFde0VIE3unEJ5idppMEW2Pk q6DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T8vQW2xfZ3nYT48XTv7O5Fvq/rW1TVfhYcpInM5Lwzo=; b=fy0+JuuUJk0tRf3JhfEoIyW48+MLumzdn28hJyCxmO70M7LVS1hkOPpX3/ppjBWnOA ofTiIti/ja5IwTIMLlSFQsRt1Wb8FflzlMmd867+L9t3wbyTxVMX876q//SptLrvbGIH mVCBqhZMr6eQspT2pzUVqBAqvthH8OZ5fhO2t/jHPAEkcAAySlKhOil+y2MImPoo1WE+ DlESVd1efT2rUq2Jo/Hyea0IQhWeOhAjhX2eMfCKn0a1Nqz4B1Pbbq4TzTCAscgC48qp ul//lMef9s07yHOJN0dVimjI8xSWFlkgGXcYfrmKI6E2Wpxki5GjocepulLHOU2qH+Z7 HxPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZM9f5QXx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si4270738plk.174.2019.01.18.03.52.39; Fri, 18 Jan 2019 03:52:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZM9f5QXx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbfARLwj (ORCPT + 13 others); Fri, 18 Jan 2019 06:52:39 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35124 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbfARLwg (ORCPT ); Fri, 18 Jan 2019 06:52:36 -0500 Received: by mail-wm1-f66.google.com with SMTP id t200so4271305wmt.0 for ; Fri, 18 Jan 2019 03:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T8vQW2xfZ3nYT48XTv7O5Fvq/rW1TVfhYcpInM5Lwzo=; b=ZM9f5QXxENn1/zcigDnvU61nSMmX6E/IaP7lKHQ1H21ACWYHq4oT4OenfjicVjDtqK agPkCIdOiHU+zZRL/8RjUpKhq0+HFQNIM4JRwWCYhZV5t2H2McQdsBn6CIqL5OZiEj6Q tGQDYpW19wJUiKGkUxUQY2JVkTr9jAYatVstg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T8vQW2xfZ3nYT48XTv7O5Fvq/rW1TVfhYcpInM5Lwzo=; b=MZjKZalISxCCSZnLllZrANVIKHdBgXT0kpBAEq6LJYiLo7EJf/55/f9uahufT7LstR jDX07VLfJNzunWKSfVrXrCMf1apWIWXYExEbZ8ecCt2z2HYoESYxiCgPubEHKpdbKNJd VkXzN9g8NAg5o27fw2VHL2STF5I3mSoEY5EdVxG/A/+cSdipT9M9z0ldXr/m5xHiZT9F YMpotcCtB/szfA76yCiA/GfSdwi2qtm0cNrv2d7BBhbNZBFNHqKymoQ8pSyJgF8+Wu8C JpsUqwg1cQdM/XP2kszOewdgBrKAF2qYhfbMBDmcFaPTxWJIw/RyQZvsCJeHgIyjTwOh LFpw== X-Gm-Message-State: AJcUukfVIXYw1GFmIbn/4kUirlZTmI/RRK7hqU229JZ9eXESXZ2jUKy0 grgwyEReSTYhJ8i1hGo34Js+zw== X-Received: by 2002:a1c:9d57:: with SMTP id g84mr15707901wme.16.1547812354308; Fri, 18 Jan 2019 03:52:34 -0800 (PST) Received: from localhost.localdomain (146-241-71-93.dyn.eolo.it. [146.241.71.93]) by smtp.gmail.com with ESMTPSA id i13sm75183049wrw.32.2019.01.18.03.52.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 03:52:33 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, hurikhan77+bko@gmail.com, Paolo Valente Subject: [PATCH BUGFIX RFC 1/2] Revert "bfq-iosched: remove unused variable" Date: Fri, 18 Jan 2019 12:52:18 +0100 Message-Id: <20190118115219.63576-2-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118115219.63576-1-paolo.valente@linaro.org> References: <20190118115219.63576-1-paolo.valente@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit bd7d4ef6a4c9b3611fa487a0065bf042c71ce620. --- block/bfq-iosched.c | 15 ++++++++------- block/bfq-iosched.h | 6 ++++++ 2 files changed, 14 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index cd307767a134..8cc3032b66de 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5303,25 +5303,26 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, struct sbitmap_queue *bt) { unsigned int i, j, min_shallow = UINT_MAX; + bfqd->sb_shift = bt->sb.shift; /* * In-word depths if no bfq_queue is being weight-raised: * leaving 25% of tags only for sync reads. * * In next formulas, right-shift the value - * (1U<sb.shift), instead of computing directly - * (1U<<(bt->sb.shift - something)), to be robust against - * any possible value of bt->sb.shift, without having to + * (1U<sb_shift), instead of computing directly + * (1U<<(bfqd->sb_shift - something)), to be robust against + * any possible value of bfqd->sb_shift, without having to * limit 'something'. */ /* no more than 50% of tags for async I/O */ - bfqd->word_depths[0][0] = max((1U << bt->sb.shift) >> 1, 1U); + bfqd->word_depths[0][0] = max((1U<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(((1U << bt->sb.shift) * 3) >> 2, 1U); + bfqd->word_depths[0][1] = max(((1U<sb_shift) * 3)>>2, 1U); /* * In-word depths in case some bfq_queue is being weight- @@ -5331,9 +5332,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(((1U << bt->sb.shift) * 3) >> 4, 1U); + bfqd->word_depths[1][0] = max(((1U<sb_shift) * 3)>>4, 1U); /* no more than ~37% of tags for sync writes (~20% extra tags) */ - bfqd->word_depths[1][1] = max(((1U << bt->sb.shift) * 6) >> 4, 1U); + bfqd->word_depths[1][1] = max(((1U<sb_shift) * 6)>>4, 1U); for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h index 0b02bf302de0..4de5dc349a1e 100644 --- a/block/bfq-iosched.h +++ b/block/bfq-iosched.h @@ -697,6 +697,12 @@ struct bfq_data { /* bfqq associated with the task issuing current bio for merging */ struct bfq_queue *bio_bfqq; + /* + * Cached sbitmap shift, used to compute depth limits in + * bfq_update_depths. + */ + unsigned int sb_shift; + /* * Depth limits used in bfq_limit_depth (see comments on the * function) From patchwork Fri Jan 18 11:52:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 155922 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3163643jaa; Fri, 18 Jan 2019 03:52:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN422e/OrC5aESV4mQ57K7Nh6TEMAUjc82z4J3+BOyRB0YT7mbvOQWaay/+LAUsoym++NbKB X-Received: by 2002:a62:5d0c:: with SMTP id r12mr19808790pfb.0.1547812362760; Fri, 18 Jan 2019 03:52:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547812362; cv=none; d=google.com; s=arc-20160816; b=Ld8oJS1BG9PR9ikZBk2JUtzTw49qyTO1v2MUtJNYsRU4ny7HKQRHjfGi8vnFy0Ky2W nusiyxTI6gugR07YJ2GB5CXO7Qcs/pG7hhJWb54UBYrsvujKVe5RgFg76Op+voeGZigD p0CCY2sFX9kvsomeArNNtjO547h8jXDUueH85OJ9njjwstB2838O+ghKGbEsX8iqmGv3 8lG5ahy4KeNulyBBhmyrdADoO7vWNXw5uhoYvjAaDLej8w9J1zdgVm0s8Qcq3YDyRO4a tOPkjG7DnvSEcX6bjOZRr1SouRn00a1NVRZ8OzfxICpNt55XJfNkOBpZAwTxwOG+Sclw eFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T27H7ztOcp7A/3V22IUmBI8925liW6dEWx0lFYpzxQM=; b=OWj+pQ10OIt6v0tMo/8zDrNd2R225Vg9fVGl3EwE9s3RHnj5GDl0s1yeirFJyD+QSd SjQOu72vBNTs9Z67ulL1W++vkGXi1YMpINW1ca1kB9n6iligWwav/753KgkERvgwNu5x HcHGqwdETyZ0wsMLlZ6iDpComK1NvjHbsP+Z+kLx87ooXeI6/6Chln/9PNCDNf/+zwzn 1MIxK1oRgn4ABq7q5VlodSJTrTT843Df4oJ1i0MfjCKI/RHFzcbEtzx7s002y2sZwHZF 7dCVdVb+WLc2BBHQQiLbM8TteEY3L36tOkMe0Y0+O5Il+0DA7C/KR4MKGxgHDgA9C/cI eWmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBXZJ1xr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36si4382754pgt.213.2019.01.18.03.52.42; Fri, 18 Jan 2019 03:52:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KBXZJ1xr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727496AbfARLwk (ORCPT + 13 others); Fri, 18 Jan 2019 06:52:40 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:50898 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfARLwi (ORCPT ); Fri, 18 Jan 2019 06:52:38 -0500 Received: by mail-wm1-f68.google.com with SMTP id n190so4263197wmd.0 for ; Fri, 18 Jan 2019 03:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T27H7ztOcp7A/3V22IUmBI8925liW6dEWx0lFYpzxQM=; b=KBXZJ1xr/Gu0llfl5PqSk6cW/UpSN10BkwwI+mbh83BYmn3Od9x+bRjey4zR/RiNqU VGKn1Zjq6+69gkWbvt4PvxyX/aiEEnwU6peo0Rt5njglMFdxEZMoVYF/y1eEPsbM+1Ts oUvCpdXtySPwkRZ7eC80EX7yqjPvMh3HpMhB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T27H7ztOcp7A/3V22IUmBI8925liW6dEWx0lFYpzxQM=; b=fEpUlEhYkSFIF1ZXtzmsiIxCIOuqtul32f/JM7FpfCU2TdDM4Y6thZoyQfY9oJbXQE 9+eGJTDbJoSegRG0pdXULNyzLjxm9So/FgKmb0/FVOa2GQEXaOhgHNJ1P2O+7kH/bvrW gnzvTLwnUR15SbK5X9RQz/qMPuKCW0DV+b2HhvsSK9vY4hoqmdYqju2n1eNH0qPjw12f PbGqoY0LDESJ6HAqhvzo5fdsf++40hnHY+8YVwgjGZXLIkcfurBYHGS/d/WuYdY0jrbW 1OzBe4vacwh7jK5rD++PwCfSXgkA1xRfuHtx85FjOZxg8wzBxHjf5U9FReYSdM97tWuC V8dQ== X-Gm-Message-State: AJcUukcymGa55NxFWu3ASeenFdouTHCjL9p3mM8z6Rc2L+RH/CP7zHhe MMZFDZVw8ITV0KUfRLCzDG2q4qmsGA9B1Q== X-Received: by 2002:a1c:9a0d:: with SMTP id c13mr15884561wme.41.1547812355617; Fri, 18 Jan 2019 03:52:35 -0800 (PST) Received: from localhost.localdomain (146-241-71-93.dyn.eolo.it. [146.241.71.93]) by smtp.gmail.com with ESMTPSA id i13sm75183049wrw.32.2019.01.18.03.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 03:52:35 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, hurikhan77+bko@gmail.com, Paolo Valente Subject: [PATCH BUGFIX RFC 2/2] Revert "bfq: calculate shallow depths at init time" Date: Fri, 18 Jan 2019 12:52:19 +0100 Message-Id: <20190118115219.63576-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118115219.63576-1-paolo.valente@linaro.org> References: <20190118115219.63576-1-paolo.valente@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit f0635b8a416e3b99dc6fd9ac3ce534764869d0c8. --- block/bfq-iosched.c | 117 +++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 60 deletions(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 8cc3032b66de..92214d58510c 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -520,6 +520,54 @@ static struct request *bfq_choose_req(struct bfq_data *bfqd, } } +/* + * See the comments on bfq_limit_depth for the purpose of + * the depths set in the function. Return minimum shallow depth we'll use. + */ +static unsigned int bfq_update_depths(struct bfq_data *bfqd, + struct sbitmap_queue *bt) +{ + unsigned int i, j, min_shallow = UINT_MAX; + bfqd->sb_shift = bt->sb.shift; + + /* + * In-word depths if no bfq_queue is being weight-raised: + * leaving 25% of tags only for sync reads. + * + * In next formulas, right-shift the value + * (1U<sb_shift), instead of computing directly + * (1U<<(bfqd->sb_shift - something)), to be robust against + * any possible value of bfqd->sb_shift, without having to + * limit 'something'. + */ + /* no more than 50% of tags for async I/O */ + bfqd->word_depths[0][0] = max((1U<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(((1U<sb_shift) * 3)>>2, 1U); + + /* + * In-word depths in case some bfq_queue is being weight- + * raised: leaving ~63% of tags for sync reads. This is the + * highest percentage for which, in our tests, application + * start-up times didn't suffer from any regression due to tag + * shortage. + */ + /* no more than ~18% of tags for async I/O */ + bfqd->word_depths[1][0] = max(((1U<sb_shift) * 3)>>4, 1U); + /* no more than ~37% of tags for sync writes (~20% extra tags) */ + bfqd->word_depths[1][1] = max(((1U<sb_shift) * 6)>>4, 1U); + + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + min_shallow = min(min_shallow, bfqd->word_depths[i][j]); + + return min_shallow; +} + /* * Async I/O can easily starve sync I/O (both sync reads and sync * writes), by consuming all tags. Similarly, storms of sync writes, @@ -529,11 +577,20 @@ static struct request *bfq_choose_req(struct bfq_data *bfqd, */ static void bfq_limit_depth(unsigned int op, struct blk_mq_alloc_data *data) { + struct blk_mq_tags *tags = blk_mq_tags_from_data(data); struct bfq_data *bfqd = data->q->elevator->elevator_data; + struct sbitmap_queue *bt; if (op_is_sync(op) && !op_is_write(op)) return; + bt = &tags->bitmap_tags; + + if (unlikely(bfqd->sb_shift != bt->sb.shift)) { + unsigned int min_shallow = bfq_update_depths(bfqd, bt); + sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow); + } + data->shallow_depth = bfqd->word_depths[!!bfqd->wr_busy_queues][op_is_sync(op)]; @@ -5295,65 +5352,6 @@ void bfq_put_async_queues(struct bfq_data *bfqd, struct bfq_group *bfqg) __bfq_put_async_bfqq(bfqd, &bfqg->async_idle_bfqq); } -/* - * See the comments on bfq_limit_depth for the purpose of - * the depths set in the function. Return minimum shallow depth we'll use. - */ -static unsigned int bfq_update_depths(struct bfq_data *bfqd, - struct sbitmap_queue *bt) -{ - unsigned int i, j, min_shallow = UINT_MAX; - bfqd->sb_shift = bt->sb.shift; - - /* - * In-word depths if no bfq_queue is being weight-raised: - * leaving 25% of tags only for sync reads. - * - * In next formulas, right-shift the value - * (1U<sb_shift), instead of computing directly - * (1U<<(bfqd->sb_shift - something)), to be robust against - * any possible value of bfqd->sb_shift, without having to - * limit 'something'. - */ - /* no more than 50% of tags for async I/O */ - bfqd->word_depths[0][0] = max((1U<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(((1U<sb_shift) * 3)>>2, 1U); - - /* - * In-word depths in case some bfq_queue is being weight- - * raised: leaving ~63% of tags for sync reads. This is the - * highest percentage for which, in our tests, application - * start-up times didn't suffer from any regression due to tag - * shortage. - */ - /* no more than ~18% of tags for async I/O */ - bfqd->word_depths[1][0] = max(((1U<sb_shift) * 3)>>4, 1U); - /* no more than ~37% of tags for sync writes (~20% extra tags) */ - bfqd->word_depths[1][1] = max(((1U<sb_shift) * 6)>>4, 1U); - - for (i = 0; i < 2; i++) - for (j = 0; j < 2; j++) - min_shallow = min(min_shallow, bfqd->word_depths[i][j]); - - return min_shallow; -} - -static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) -{ - struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; - struct blk_mq_tags *tags = hctx->sched_tags; - unsigned int min_shallow; - - min_shallow = bfq_update_depths(bfqd, &tags->bitmap_tags); - sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow); - return 0; -} - static void bfq_exit_queue(struct elevator_queue *e) { struct bfq_data *bfqd = e->elevator_data; @@ -5773,7 +5771,6 @@ static struct elevator_type iosched_bfq_mq = { .requests_merged = bfq_requests_merged, .request_merged = bfq_request_merged, .has_work = bfq_has_work, - .init_hctx = bfq_init_hctx, .init_sched = bfq_init_queue, .exit_sched = bfq_exit_queue, },