2016-04-19 07:23:12

by zhong jiang

[permalink] [raw]
Subject: A mainline question about cgroup writeback

cgroup writeback support the filesystem both ext4 and ext2.
but, it appears to be not work when I test the function in the ext4.
The example is as follows:
echo "8:0 1048576" > blkio.throttle.write_bps_device
echo $$ > cgroup.procs
dd if=/dev/zero of=/test.c bs=1M count=10240
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 49.8796 s, 215 MB/s

Furthering test find that the ratelimit will be limited if it write data
to disk directly. Additionly, The read ratelimit is limited whther it go through
the page cache or not.

The kernel version is 4.6 I have tested, And the corresponding files
in the attachment


Attachments:
euler_defconfig (134.84 kB)

2016-04-20 06:32:57

by Alex Shi

[permalink] [raw]
Subject: Re: A mainline question about cgroup writeback

It looks like a bug on cgroup writeback. Is this a regression or
consistent issue? If it's a regression, you may could do bisect to
find out the buggy commit.

On Tue, Apr 19, 2016 at 3:19 PM, zhong jiang <[email protected]> wrote:
> cgroup writeback support the filesystem both ext4 and ext2.
> but, it appears to be not work when I test the function in the ext4.
> The example is as follows:
> echo "8:0 1048576" > blkio.throttle.write_bps_device
> echo $$ > cgroup.procs
> dd if=/dev/zero of=/test.c bs=1M count=10240
> 10240+0 records in
> 10240+0 records out
> 10737418240 bytes (11 GB) copied, 49.8796 s, 215 MB/s
>
> Furthering test find that the ratelimit will be limited if it write data
> to disk directly. Additionly, The read ratelimit is limited whther it go through
> the page cache or not.
>
> The kernel version is 4.6 I have tested, And the corresponding files
> in the attachment



--
Thanks
Alex

2016-04-20 21:22:56

by Tejun Heo

[permalink] [raw]
Subject: Re: A mainline question about cgroup writeback

On Tue, Apr 19, 2016 at 03:19:59PM +0800, zhong jiang wrote:
> cgroup writeback support the filesystem both ext4 and ext2.
> but, it appears to be not work when I test the function in the ext4.
> The example is as follows:
> echo "8:0 1048576" > blkio.throttle.write_bps_device
> echo $$ > cgroup.procs
> dd if=/dev/zero of=/test.c bs=1M count=10240
> 10240+0 records in
> 10240+0 records out
> 10737418240 bytes (11 GB) copied, 49.8796 s, 215 MB/s

How much memory does the cgroup have available to it? It's buffered
write. It might not get throttled if there are enough pages to dirty.

Thanks.

--
tejun

2016-04-21 08:40:19

by zhong jiang

[permalink] [raw]
Subject: Re: A mainline question about cgroup writeback

On 2016/4/21 5:22, Tejun Heo wrote:
> On Tue, Apr 19, 2016 at 03:19:59PM +0800, zhong jiang wrote:
>> cgroup writeback support the filesystem both ext4 and ext2.
>> but, it appears to be not work when I test the function in the ext4.
>> The example is as follows:
>> echo "8:0 1048576" > blkio.throttle.write_bps_device
>> echo $$ > cgroup.procs
>> dd if=/dev/zero of=/test.c bs=1M count=10240
>> 10240+0 records in
>> 10240+0 records out
>> 10737418240 bytes (11 GB) copied, 49.8796 s, 215 MB/s
> How much memory does the cgroup have available to it? It's buffered
> write. It might not get throttled if there are enough pages to dirty.
>
> Thanks.
>
Maybe it's my fault. I just limit two fields in dirty_background_bytes and dirty_bytes ,
and I don't consider about the available memory in the cgroup.


Thanks
zhongjiang