From: Ulf Hansson <ulf.hansson@linaro.org>
To: Paolo Valente <paolo.valente@linaro.org>
Cc: Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>,
linux-block <linux-block@vger.kernel.org>,
Luca Miccio <lucmiccio@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Mark Brown <broonie@kernel.org>,
Akinobu Mita <akinobu.mita@gmail.com>,
hpa@zytor.com, David Howells <dhowells@redhat.com>
Subject: Re: high overhead of functions blkg_*stats_* in bfq
Date: Mon, 6 Nov 2017 11:48:53 +0100 [thread overview]
Message-ID: <CAPDyKFpm_+cii6OVfgpVkww7raURE4bJmpyvWU1c_AKFhTRpZw@mail.gmail.com> (raw)
In-Reply-To: <A43A2541-10EB-4914-B033-8D2CE2442477@linaro.org>
On 6 November 2017 at 10:49, Paolo Valente <paolo.valente@linaro.org> wrote:
>
>> Il giorno 06 nov 2017, alle ore 10:22, Ulf Hansson <ulf.hansson@linaro.org> ha scritto:
>>
>> On 6 November 2017 at 03:21, Jens Axboe <axboe@kernel.dk> wrote:
>>> On 11/05/2017 01:39 AM, Paolo Valente wrote:
>>>>
>>>>> Il giorno 18 ott 2017, alle ore 15:19, Tejun Heo <tj@kernel.org> ha scritto:
>>>>>
>>>>> Hello, Paolo.
>>>>>
>>>>> On Tue, Oct 17, 2017 at 12:11:01PM +0200, Paolo Valente wrote:
>>>>> ...
>>>>>> protected by a per-device scheduler lock. To give you an idea, on an
>>>>>> Intel i7-4850HQ, and with 8 threads doing random I/O in parallel on
>>>>>> null_blk (configured with 0 latency), if the update of groups stats is
>>>>>> removed, then the throughput grows from 260 to 404 KIOPS. This and
>>>>>> all the other results we might share in this thread can be reproduced
>>>>>> very easily with a (useful) script made by Luca Miccio [1].
>>>>>
>>>>> I don't think the old request_queue is ever built for multiple CPUs
>>>>> hitting on a mem-backed device.
>>>>>
>>>>
>>>> Hi,
>>>> from our measurements, the code and the comments received so far in
>>>> this thread, I guess that reducing the execution time of blkg_*stats_*
>>>> functions is not an easy task, and is unlikely to be accomplished in
>>>> the short term. In this respect, we have unfortunately found out that
>>>> executing these functions causes a very high reduction of the
>>>> sustainable throughput on some CPUs. For example, -70% on an ARM
>>>> CortexTM-A53 Octa-core.
>>>>
>>>> Thus, to deal with such a considerable slowdown, until the overhead of
>>>> these functions gets reduced, it may make more sense to switch the
>>>> update of these statistics off, in all cases where these statistics
>>>> are not used, while higher performance (or lower power consumption) is
>>>> welcome/needed.
>>>>
>>>> We wondered, however, how hazardous it might be to switch the update
>>>> of these statistics off. To answer this question, we investigated the
>>>> extent at which these statistics are used by applications and
>>>> services. Mainly, we tried to survey relevant people or
>>>> forums/mailing lists for involved communities: Linux distributions,
>>>> systemd, containers and other minor communities. Nobody reported any
>>>> application or service using these statistics (either the variant
>>>> updated by bfq, or that updated by cfq).
>>>>
>>>> So, one of the patches we are working on gives the user the
>>>> possibility to disable the update of these statistics online.
>>>
>>> If you want help with this, provide an easy way to reproduce this,
>>> and/or some decent profiling output. There was one flamegraph posted,
>>> but that was basically useless. Just do:
>>>
>>> perf record -g -- whatever test
>>> perf report -g --no-children
>>>
>>> and post the top 10 entries from the perf report.
>>>
>>> It's pointless to give up on this so soon, when no effort has apparently
>>> been dedicated to figuring out what the actual issue is yet. So no, no
>>> patch that will just disable the stats is going to be accepted.
>>>
>>> That said, I have no idea who uses these stats. Surely someone can
>>> answer that question. Tejun?
>>
>> Jens, Tejun, apologize for side-tracking the discussion.
>>
>> It sounds to me that these stats should have been put into debugfs,
>> rather than sysfs from the beginning.
>>
>
> Ulf,
> let me just add a bit of info, if useful: four of those stat files are
> explicitly meant for debugging (as per the documentation), and created
> if CONFIG_DEBUG_BLK_CGROUP=y.
>
> Paolo
Right, so it's a mixture of debugfs/sysfs then.
In the BFQ case, it seems like CONFIG_DEBUG_BLK_CGROUP isn't checked.
I assume that should be changed, which would remove at least some of
the computation overhead when when this Kconfig is unset.
Perhaps one may even consider moving all stats for BFQ within that
Kconfig (and for other mq-schedulers if those ever intends to
implement support for the stats).
Kind regards
Uffe
next prev parent reply other threads:[~2017-11-06 10:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 10:11 high overhead of functions blkg_*stats_* in bfq Paolo Valente
2017-10-17 12:45 ` Paolo Valente
2017-10-17 16:45 ` Linus Walleij
2017-10-17 16:49 ` Jens Axboe
2017-10-18 13:19 ` Tejun Heo
2017-10-18 14:45 ` Jens Axboe
2017-10-18 15:05 ` Paolo Valente
2017-10-18 15:44 ` Jens Axboe
[not found] ` <2B52CB68-213C-470F-945C-0ADFF9AA7A66@linaro.org>
2017-10-18 15:08 ` Paolo Valente
2017-10-18 15:40 ` Paolo Valente
[not found] ` <D6586934-DF02-4102-8839-8912DFA86BB0@linaro.org>
2017-10-19 6:50 ` Paolo Valente
2017-10-21 16:13 ` Tejun Heo
2017-10-22 8:25 ` Paolo Valente
2017-10-30 9:49 ` David Howells
2017-11-05 7:39 ` Paolo Valente
2017-11-06 2:21 ` Jens Axboe
2017-11-06 9:22 ` Ulf Hansson
2017-11-06 9:49 ` Paolo Valente
2017-11-06 10:48 ` Ulf Hansson [this message]
2017-11-06 11:20 ` Paolo Valente
2017-11-06 15:00 ` Tejun Heo
2017-11-06 15:47 ` Paolo Valente
2017-11-06 16:11 ` Paolo Valente
2017-11-06 16:13 ` Jens Axboe
2017-11-06 16:21 ` Paolo Valente
2017-11-06 16:22 ` Jens Axboe
2017-11-06 16:26 ` Paolo Valente
2017-11-06 16:30 ` Tejun Heo
2017-11-06 16:33 ` Paolo Valente
2017-11-06 16:37 ` Tejun Heo
2017-11-06 16:39 ` Jens Axboe
2017-11-06 17:05 ` Paolo Valente
2017-11-06 16:03 ` Jens Axboe
2017-11-06 16:10 ` Paolo Valente
2017-11-06 18:46 ` Paolo Valente
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPDyKFpm_+cii6OVfgpVkww7raURE4bJmpyvWU1c_AKFhTRpZw@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--cc=akinobu.mita@gmail.com \
--cc=axboe@kernel.dk \
--cc=broonie@kernel.org \
--cc=dhowells@redhat.com \
--cc=hpa@zytor.com \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=lucmiccio@gmail.com \
--cc=paolo.valente@linaro.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).