From patchwork Mon Nov 13 06:34:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 118712 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1444803qgn; Sun, 12 Nov 2017 22:34:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMY/xz9G4Pi3zNbLWp2JhkiuoZc0/KACtSXrNq2GNfMnoWPB1Yx58nfJctX5F+qyHDXunQmu X-Received: by 10.98.100.74 with SMTP id y71mr5269402pfb.123.1510554875292; Sun, 12 Nov 2017 22:34:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510554875; cv=none; d=google.com; s=arc-20160816; b=aTYh56SbcpJX7pDtJh5GyqShdrwMOMJ0/rWh5DYGglcB5IT4tuFyaFhGhJvfFwroa9 wD63o/Ww/MZ9pinfWiu1HHXHwLHylHRDK4NhTbvioH9yMFyxnY4J1LPbVfw1YE0Vmx+D CwFzemRZ0FZnHchANEr9jynlq4TuzcZHdmrnic3DlLsxPREOSCkt3Hhq7axUVjg1m39u 4SkQlWiQEiQXDuuJUgrdFmiGFHTkjKMFtvgOPWF1Qhdkvb3s+z2kMiDJ4IwHXqEI09tK 6/UaTwcq3PzoNfWm278In6WAWDyItpjpyhasA1/ueBTf1euGFH61U6NzDwSl12hhtpZs BoQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Cx64I3a9ssnruoDzC0cG/d0P5wD4H7hPSf7R3F9EsQk=; b=EGTsFeIyxDdcyA8vkaHsbTbG5M3iKcZ2ihZRvfUdtULLUj2m2gIutBvayI7JDMl1/1 mRlUP5p9O/G3Gb/V1aihFLUDI0WSeIboY7VfdRtW/M5NamgPOmYHrFXNfZAw7JnN97C9 QLhzc6P1cgAEn8hQ2XEDD2gCfnIbsmUkPLGtnmrj4x1VY6XDAtFkGTv1RE4Wpfg3ccYM iWSAe7SBF1ALsnAdjYstR8P6753X1GBSENzlnjW/sndg/O6f5l5WpPwI9TQ5upK1x+q8 0lt9yN/hEghHbB115I0s5quJ6GkHEi9XXR58QYGiP+QKm/wrv9/tO1vJdwUaDT6LqJVh nFGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BOs5WSFc; 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 k33si14109561pld.29.2017.11.12.22.34.34; Sun, 12 Nov 2017 22:34:35 -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=BOs5WSFc; 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 S1751726AbdKMGeb (ORCPT + 27 others); Mon, 13 Nov 2017 01:34:31 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53753 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751407AbdKMGe3 (ORCPT ); Mon, 13 Nov 2017 01:34:29 -0500 Received: by mail-wm0-f65.google.com with SMTP id g141so12739731wmg.2 for ; Sun, 12 Nov 2017 22:34:29 -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; bh=Cx64I3a9ssnruoDzC0cG/d0P5wD4H7hPSf7R3F9EsQk=; b=BOs5WSFc6Jtn+ZC6c6S3KtMQBwgnhBIlptTmWWdLOD/j7lXyVL2DYQSuiDNisZ8eKj 3bgNHHL5s78WFe+3N1Qv5AgTSSImEUqklWMxzDkkMwBNjCkPqPnud1HDhrAyI7GsKrSs IZ59ZG3qhTAPWqhYXU1kAbSsGJmfPnPtWm/M8= 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; bh=Cx64I3a9ssnruoDzC0cG/d0P5wD4H7hPSf7R3F9EsQk=; b=VJJ7A1amvJU53Ulfp3u0EffCZKpaHbuFZc3GWBuw601NE48mvA0EIiqVkjvFQeax2U SLF08fbEW9K3XOmOni4jeztlUjXd6MkP9MdItA8vJcSlzQox4c3Wa7CPpPFtjXNIGUBt S1zSw0vI189eZsnX5VbHj9Ti10t43Ru0n1owX7E1mXyLoTGg0I6u69C0zt3IJ5GVVsqW kNydUGX6U0/GySEdn9d7tdMjJwavsbvQDSWaGhhvIbMaC67x42w9IUphT9c/ejp5cwW0 Fa6oL/6tz4e1YRpwUG4LgkABagKhpKtyfTyMj5l0SPcbQdxECTwQgOwhT/04dTtgbdNx lprA== X-Gm-Message-State: AJaThX4BithEeh7H3FqJ9o/yR2Rw4E57QHzunNb/9WoE5a1t7ppcLNtp 5z9yb6aat+bMfy5sRWaakbHPbw== X-Received: by 10.28.223.198 with SMTP id w189mr2679983wmg.60.1510554868092; Sun, 12 Nov 2017 22:34:28 -0800 (PST) Received: from localhost.localdomain ([5.169.167.83]) by smtp.gmail.com with ESMTPSA id 10sm11158429wml.27.2017.11.12.22.34.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 12 Nov 2017 22:34:27 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, broonie@kernel.org, linus.walleij@linaro.org, lee.tibbert@gmail.com, oleksandr@natalenko.name, lucmiccio@gmail.com, bfq-iosched@googlegroups.com, Paolo Valente Subject: [PATCH IMPROVEMENT/BUGFIX 0/4] block, bfq: increase sustainable IOPS and fix a bug Date: Mon, 13 Nov 2017 07:34:06 +0100 Message-Id: <20171113063410.3029-1-paolo.valente@linaro.org> X-Mailer: git-send-email 2.10.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, these patches address the following issue, raised and discussed in [1]. BFQ provides a proportional share policy for the blkio controller. In this respect, BFQ updates the I/O accounting related to its policy, i.e., the statistics contained in the special files blkio.bfq.* in blkio groups (these files are the bfq counterpart of the blkio.* statistic files updated by CFQ). To update these statistics, BFQ invokes some blkg_*stats_* functions. We have found out that these functions take a considerable percentage, about 40%, of the total execution time of BFQ. This patch series contains two patches to address this issue, namely the patches anticipated and discussed in their main aspects in [1]. The first of these two patches is patch 3/4 in this series: it enables BFQ to execute the above blkg_*stats_* functions, where possible, in parallel with the rest of the code of the scheduler. With this improvement, the maximum request-processing rate sustainable with BFQ grows by 25%-30%, depending on the CPU. For instance, it grows from 250 to 310 KIOPS on an Intel i7-4850HQ. These results, and the others reported in this letter, have been obtained and can be reproduced very easily with the script [2]. Unfortunately, even after the above improvement, blkg_*stats_* functions still cause a noticeable loss of sustainable throughput. To give an idea, on an Intel i7-4850HQ, if the update of blkio.bfq.* statistics is not performed at all, then the sustainable throughput grows from 310 to 400 KIOPS. This issue has been already discussed in [1] as well. In brief, we agreed to make a further commit, which introduces the possibility to disable/re-enable at boot, or at module-loading time, the updating of all blkio statistics for proportional-share policies, i.e., of both those updated by BFQ and those updated by CFQ. We are already working on that commit, but finalizing it will take some time. Fortunately, following a suggestion/recommendation of Tejun in the same thread [2], it is already possible to drastically increase BFQ performance, when no blkio-debugging information is needed. Tejun's suggestion/recommendation is to move most blkio.bfq.* statistics behind an already existing config option, CONFIG_DEBUG_BLK_CGROUP. Patch 4/4 in this series does that. Thanks to this change, if CONFIG_DEBUG_BLK_CGROUP is not set, then bfq does attain a further boost in sustainable throughput, which ranges from +30% to +45%, depending on the CPU (some figures in the documentation). The above two patches are preceded by two preliminary patches. The first updates the conservative range of IOPS (sustainable with BFQ) that was previously reported in the documentation. The patch replaces this piece of information with the actual, much higher limits that we have measured while working at the above two commits. The second preliminary patch fixes a functional bug, related to the update of the above statistics. We waited for one week of testing from bfq users before submitting these patches. We hope we are still in time for having these improvements and fixes considered for 4.15. NOTE. Two definitions of empty functions in patch 4/4 trigger the following checkpatch error: "open brace '{' following function definitions go on the next line". Unfortunately, following this recommendation does seem to worsen code in our case: in addition to making these two definitions slightly harder to read, it would break symmetry with respect to all other definitions of empty functions, both those already present in the base code, and those added by the patch itself. In particular, in all those other definitions, the empty body of the functions is on the same line as the prototypes of the functions. Oddly, the latter definitions do not cause the same error report. Thanks, Paolo [1] https://www.spinics.net/lists/linux-block/msg18943.html [2] https://github.com/Algodev-github/IOSpeed Luca Miccio (2): block, bfq: add missing invocations of bfqg_stats_update_io_add/remove block, bfq: move debug blkio stats behind CONFIG_DEBUG_BLK_CGROUP Paolo Valente (2): doc, block, bfq: update max IOPS sustainable with BFQ block, bfq: update blkio stats outside the scheduler lock Documentation/block/bfq-iosched.txt | 43 +++++++++-- block/bfq-cgroup.c | 148 ++++++++++++++++++++---------------- block/bfq-iosched.c | 117 ++++++++++++++++++++++++++-- block/bfq-iosched.h | 4 +- block/bfq-wf2q.c | 1 - 5 files changed, 233 insertions(+), 80 deletions(-) -- 2.10.0