From: Josef Bacik <josef@toxicpanda.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Josef Bacik <josef@toxicpanda.com>,
axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org,
hannes@cmpxchg.org, tj@kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 00/14][V5] Introduce io.latency io controller for cgroups
Date: Mon, 2 Jul 2018 17:38:05 -0400 [thread overview]
Message-ID: <20180702213804.vcfr4auvunpkd2ky@destiny> (raw)
In-Reply-To: <20180702142639.752759da566fd9074cf8edfe@linux-foundation.org>
On Mon, Jul 02, 2018 at 02:26:39PM -0700, Andrew Morton wrote:
> On Fri, 29 Jun 2018 15:25:28 -0400 Josef Bacik <josef@toxicpanda.com> wrote:
>
> > This series adds a latency based io controller for cgroups. It is based on the
> > same concept as the writeback throttling code, which is watching the overall
> > total latency of IO's in a given window and then adjusting the queue depth of
> > the group accordingly. This is meant to be a workload protection controller, so
> > whoever has the lowest latency target gets the preferential treatment with no
> > thought to fairness or proportionality. It is meant to be work conserving, so
> > as long as nobody is missing their latency targets the disk is fair game.
> >
> > We have been testing this in production for several months now to get the
> > behavior right and we are finally at the point that it is working well in all of
> > our test cases. With this patch we protect our main workload (the web server)
> > and isolate out the system services (chef/yum/etc). This works well in the
> > normal case, smoothing out weird request per second (RPS) dips that we would see
> > when one of the system services would run and compete for IO resources. This
> > also works incredibly well in the runaway task case.
> >
> > The runaway task usecase is where we have some task that slowly eats up all of
> > the memory on the system (think a memory leak). Previously this sort of
> > workload would push the box into a swapping/oom death spiral that was only
> > recovered by rebooting the box. With this patchset and proper configuration of
> > the memory.low and io.latency controllers we're able to survive this test with a
> > at most 20% dip in RPS.
>
> Is this purely useful for spinning disks, or is there some
> applicability to SSDs and perhaps other storage devices? Some
> discussion on this topic would be useful.
>
Yes we're using this on SSDs and spinning rust, it would work on all storage
devices, you just have to adjust your latency targets accordingly.
> Patches 5, 7 & 14 look fine to me - go wild. #14 could do with a
> couple of why-we're-doing-this comments, but I say that about
> everything ;)
>
So that one was fun. Our test has the main workload going in the protected
group, and all the system specific stuff in an unprotected group and then we run
a memory hog in the system group. Obviously this results in everybody dumping
all caches first, including pages for the binaries themselves. Then when the
applications go to run they incur a page fault, which trips readahead. If we're
throttling this means we'll sit in the page fault handler for a good long while.
Who cares right? Well apparently the main workload cares, because it talks to
some daemon about the current memory on the system so it can make intelligent
adjustments on its allocation strategies. The daemon it talks to also gathers a
bunch of other statistics, and does things like 'ps' which goes and walks
/proc/<pid>, which has entries that wait on mmap_sem. So suddenly being block
in readahead means we have weird latency spikes because we're holding the
mmap_sem the whole time. So instead we want to just skip readahead so we are
getting throttled as little as possible while holding our mmap_sem.
The inflight READA bio's also need to be aborted, and I have a patch for that as
well, but it depends on Jens' READA abort patches that he's still working on, so
that part will come after his stuff is ready. Thanks,
Josef
next prev parent reply other threads:[~2018-07-02 21:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 19:25 Josef Bacik
2018-06-29 19:25 ` [PATCH 01/14] block: add bi_blkg to the bio " Josef Bacik
2018-06-29 19:25 ` [PATCH 02/14] block: introduce bio_issue_as_root_blkg Josef Bacik
2018-06-29 19:25 ` [PATCH 03/14] blk-cgroup: allow controllers to output their own stats Josef Bacik
2018-07-02 21:06 ` Tejun Heo
2018-06-29 19:25 ` [PATCH 04/14] blk: introduce REQ_SWAP Josef Bacik
2018-07-02 21:47 ` Jens Axboe
2018-06-29 19:25 ` [PATCH 05/14] swap,blkcg: issue swap io with the appropriate context Josef Bacik
2018-06-29 19:25 ` [PATCH 06/14] blkcg: add generic throttling mechanism Josef Bacik
2018-06-29 19:25 ` [PATCH 07/14] memcontrol: schedule throttling if we are congested Josef Bacik
2018-06-29 19:25 ` [PATCH 08/14] blk-stat: export helpers for modifying blk_rq_stat Josef Bacik
2018-06-29 19:25 ` [PATCH 09/14] blk-rq-qos: refactor out common elements of blk-wbt Josef Bacik
2018-06-29 19:25 ` [PATCH 10/14] block: remove external dependency on wbt_flags Josef Bacik
2018-06-29 19:25 ` [PATCH 11/14] rq-qos: introduce dio_bio callback Josef Bacik
2018-06-29 19:25 ` [PATCH 12/14] block: introduce blk-iolatency io controller Josef Bacik
2018-07-02 21:47 ` Tejun Heo
2018-06-29 19:25 ` [PATCH 13/14] Documentation: add a doc for blk-iolatency Josef Bacik
2018-07-02 21:49 ` Tejun Heo
2018-06-29 19:25 ` [PATCH 14/14] skip readahead if the cgroup is congested Josef Bacik
2018-07-02 21:13 ` Tejun Heo
2018-07-02 21:26 ` [PATCH 00/14][V5] Introduce io.latency io controller for cgroups Andrew Morton
2018-07-02 21:38 ` Josef Bacik [this message]
2018-07-02 21:41 ` Jens Axboe
2018-07-02 21:47 ` Andrew Morton
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=20180702213804.vcfr4auvunpkd2ky@destiny \
--to=josef@toxicpanda.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®