Skip to contentSkip to conversation

Slow down of LTP tests aiodio_sparse.c and dio_sparse.c in kernel 6.6

RFC Petr Vorel 4 participants 8 messages Jul 19, 2024 – Jul 24, 2024

Subsystems (2)
lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi all,

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

Because the slowdown has been here for few kernel releases I suppose nobody complained and the test is somehow artificial (nobody uses this in a real world). But still it'd be good to double check the problem. I can bisect a particular commit.

Because 2 filesystems affected, could be "Improve asynchronous iomap DIO performance" [4] block layer change somehow related?

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
[2] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/io/ltp-aiodio/dio_sparse.c
[3] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/io/ltp-aiodio/common.h
[4] https://kernelnewbies.org/Linux_6.6#Block_layer

maintainer
#1 lore raw
Quoted 12 lines · Petr Vorel

Hi all,

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

Quoted 7 lines

Because the slowdown has been here for few kernel releases I suppose nobody complained and the test is somehow artificial (nobody uses this in a real world). But still it'd be good to double check the problem. I can bisect a particular commit.

Because 2 filesystems affected, could be "Improve asynchronous iomap DIO performance" [4] block layer change somehow related?

No, because that got disabled before release for unrelated reasons. Why don't you just bisect it, since you have a simple test case?

Signature · 1 line
Jens Axboe
author
#2 lore raw

Hi Jens, all,

Quoted 18 lines · Petr Vorel
Quoted 16 lines

Hi all,

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

Because the slowdown has been here for few kernel releases I suppose nobody complained and the test is somehow artificial (nobody uses this in a real world). But still it'd be good to double check the problem. I can bisect a particular commit.

Quoted 5 lines
Quoted 2 lines

Because 2 filesystems affected, could be "Improve asynchronous iomap DIO performance" [4] block layer change somehow related?

No, because that got disabled before release for unrelated reasons. Why don't you just bisect it, since you have a simple test case?

Jens, thanks for info. Sure, I'll bisect next week and report.

The reason I reported before bisecting is because it wouldn't be the first time the test was "artificial" and therefore reported problem was not fixed. If it's a real problem I would expect it would be also caught by other people or even by fstests.

Kind regards,
Petr

maintainer
#3 lore raw
Quoted 26 lines · Petr Vorel

Hi Jens, all,

Quoted 18 lines · Petr Vorel
Quoted 16 lines

Hi all,

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

Because the slowdown has been here for few kernel releases I suppose nobody complained and the test is somehow artificial (nobody uses this in a real world). But still it'd be good to double check the problem. I can bisect a particular commit.

Quoted 5 lines
Quoted 2 lines

Because 2 filesystems affected, could be "Improve asynchronous iomap DIO performance" [4] block layer change somehow related?

No, because that got disabled before release for unrelated reasons. Why don't you just bisect it, since you have a simple test case?

Quoted 6 lines

Jens, thanks for info. Sure, I'll bisect next week and report.

The reason I reported before bisecting is because it wouldn't be the first time the test was "artificial" and therefore reported problem was not fixed. If it's a real problem I would expect it would be also caught by other people or even by fstests.

Didn't look at the test cases, so yeah may very well be bogus. But it also may not... And a bisection may help shine some light on that too, outside of just highlighting what commit made it slower.

Signature · 1 line
Jens Axboe
#4 lore raw
In reply to Petr Vorel

Hi!

Quoted 5 lines · Petr Vorel

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

So the performance of this test is irrelevant because combining buffered reads with direct IO writes was always in "better don't do it" territory. Definitely not if you care about perfomance.

Quoted 4 lines

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

But still it's kind of curious what caused the 9x slow down. So I'd be curious to know the result of the bisection :). Thanks for report!

Honza

Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author
#5 lore raw

Hi Jan, all,

Quoted 9 lines

Hi!

Quoted 5 lines · Petr Vorel

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

Quoted 3 lines

So the performance of this test is irrelevant because combining buffered reads with direct IO writes was always in "better don't do it" territory. Definitely not if you care about perfomance.

Thanks a lot for having a look, Jan!

Quoted 7 lines
Quoted 4 lines

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

But still it's kind of curious what caused the 9x slow down. So I'd be curious to know the result of the bisection :). Thanks for report!

I'm already working on it, report soon.

Kind regards,
Petr

Quoted 1 line

Honza

author
#6 lore raw
In reply to Jan Kara

Hi all,

[ Cc Peter and Mike ]

Quoted 13 lines

Hi!

Quoted 5 lines · Petr Vorel

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

So the performance of this test is irrelevant because combining buffered reads with direct IO writes was always in "better don't do it" territory. Definitely not if you care about perfomance.

Quoted 7 lines
Quoted 4 lines

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

But still it's kind of curious what caused the 9x slow down. So I'd be curious to know the result of the bisection :). Thanks for report!

It looks to be the slowdown was introduced by commit 63304558ba5d ("sched/eevdf: Curb wakeup-preemption") [1] from v6.6-rc1.

I also compiled current next (next-20240724), it's also slow and reverting commit from it returns the original speed on both Btrfs and XFS.

Kind regards,
Petr

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=63304558ba5dcaaff9e052ee43cfdcc7f9c29e85

Quoted 1 line

Honza

#7 lore raw
Quoted 22 lines · Petr Vorel

Hi all,

[ Cc Peter and Mike ]

Quoted 17 lines

Hi!

Quoted 5 lines · Petr Vorel

LTP AIO DIO tests aiodio_sparse.c [1] and dio_sparse.c [2] (using [3]) slowed down on kernel 6.6 on Btrfs and XFS, when run with default parameters. These tests create 100 MB sparse file and write zeros (using libaio or O_DIRECT) while 16 other processes reads the buffer and check only zero is there.

So the performance of this test is irrelevant because combining buffered reads with direct IO writes was always in "better don't do it" territory. Definitely not if you care about perfomance.

Quoted 4 lines

Runtime of this particular setup (i.e. 100 MB file) on Btrfs and XFS on the same system slowed down 9x (6.5: ~1 min 6.6: ~9 min). Ext4 is not affected. (Non default parameter creates much smaller file, thus the change is not that obvious).

Quoted 5 lines
Quoted 2 lines

But still it's kind of curious what caused the 9x slow down. So I'd be curious to know the result of the bisection :). Thanks for report!

It looks to be the slowdown was introduced by commit 63304558ba5d ("sched/eevdf: Curb wakeup-preemption") [1] from v6.6-rc1.

That's not good, I'd rather not have over-zealous preemption back, my box doesn't miss that one tiny bit.

Hrm... have you tried Peter's eevdf queue? The DELAY_DEQUEUE feature therein does good things for tbench, restoring pre-eevdf throughput.

-Mike