From: Dave Chinner <david@fromorbit.com>
To: Shaohua Li <shli@kernel.org>
Cc: linux-xfs@vger.kernel.org, darrick.wong@oracle.com,
tj@kernel.org, Kernel-team@fb.com
Subject: Re: [PATCH V2] xfs: implement cgroup writeback support
Date: Mon, 16 Oct 2017 17:22:44 +1100 [thread overview]
Message-ID: <20171016062244.GI3666@dastard> (raw)
In-Reply-To: <20171016033538.5y2xnxkddhrcjlmj@kernel.org>
On Sun, Oct 15, 2017 at 08:35:39PM -0700, Shaohua Li wrote:
> On Mon, Oct 16, 2017 at 09:22:02AM +1100, Dave Chinner wrote:
> > On Sat, Oct 14, 2017 at 10:07:51PM -0700, Shaohua Li wrote:
> > > From: Shaohua Li <shli@fb.com>
> > >
> > > Basically this is a copy of commit 001e4a8775f6(ext4: implement cgroup
> > > writeback support). Tested with a fio test, verified writeback is
> > > throttled against cgroup io.max write bandwidth, also verified moving
> > > the fio test to another cgroup and the writeback is throttled against
> > > new cgroup setting.
> > >
> > > I created a test for this as attached, please try! I'll send the test out for
> > > inclusion later.
> >
> > Hmmm. The test you appended just checks that bytes get written.
> > That's pretty much useless for verification of the features you
> > describe above (throttling rate it correct, dynamic throttle
> > application as memcg config changes).
> >
> > You explicitly state this is a memcg IO QoS feature and that you
> > have a set of fio tests that verify that it works as expected. We
> > need those "works as expected" fio tests formalised into automated
> > fstests. Both upstream fs developers and downstream distro QE
> > departments need to be able to verify that the bandwidth control and
> > throttling works as advertised - it's essential that we have
> > regression tests for this....
>
> Right, this test only verifies the writeback is correctly charged to a cgroup,
> it doesn't verify the writeback is running in correct bandwidth. I did try to
> create such automatic test, but my attempt failed.
<sigh>
> To measure speed, we need measure the time for a test. But
> writeback is async, the file write finishes before the data is
> written to disk. We can't call a fsync, because fsync write is
> different than writeback write, which is charged to correct cgroup
> even without cgroup writeback support.
What a fucking mess. We were told that if we didn't implement the
writeback hooks in the filesystem then the memcg write throttling
would not be active on the filesystem.
Looks like we got taken for a bunch of suckers, eh?
So now I don't trust what we've been told about metadata IO being
ignored by memcg throttling. What happens to REQ_META IO from within
a throttled memcg task context? Does that also get throttled
according to the current task memcg limits?
> For my test, I run iostat and check the disk
> speed is correct, so I don't have idea to create an automatic test.
Seems to me like there is an obvious answer to your problem:
syncfs()
That is, syncfs uses the bdi flusher threads to do async writeback
of all outstanding dirty data on the filesystem, and it also waits
for that async writeback to complete. e.g: set the writeback
throttle speed to 5MB/s then run:
# time xfs_io -f -c "pwrite 0 100m" -c "syncfs" /path/to/file
If that takes less than 20s to run, then async writeback through the
bdi flusher workqueue wasn't throttled properly.
You can use this basic concept to do all manner of more complex
testing, including changing throttle rates and the memcgs that tasks
belong to.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2017-10-16 6:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 5:07 [PATCH V2] xfs: implement cgroup writeback support Shaohua Li
2017-10-15 22:22 ` Dave Chinner
2017-10-16 3:35 ` Shaohua Li
2017-10-16 6:22 ` Dave Chinner [this message]
2017-10-18 5:18 ` Shaohua Li
2017-10-19 7:35 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2018-03-22 21:11 Shaohua Li
2018-03-23 14:00 ` Chris Mason
2018-03-23 14:24 ` 张本龙
2018-03-25 21:59 ` Dave Chinner
2018-03-26 16:28 ` Brian Foster
2018-03-27 0:55 ` Shaohua Li
2018-03-27 11:36 ` Brian Foster
2018-03-27 21:56 ` Dave Chinner
2018-03-28 11:32 ` Brian Foster
2018-03-28 22:35 ` Dave Chinner
2018-03-28 4:37 ` 张本龙
2018-03-28 11:24 ` Brian Foster
[not found] ` <CAJDdQW3gOa8ry_XVkcCMf2QT7wC7MvU4b94hMhwJsg9MjYoKgQ@mail.gmail.com>
2018-03-27 11:50 ` Brian Foster
2018-03-28 9:55 ` 张本龙
2018-03-23 14:37 ` Brian Foster
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=20171016062244.GI3666@dastard \
--to=david@fromorbit.com \
--cc=Kernel-team@fb.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=shli@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;
as well as URLs for NNTP newsgroup(s).