FS#10512 - x86_64 Disk I/O Issues in Kernel26
Attached to Project:
Arch Linux
Opened by Daniel Rammelt (shazeal) - Monday, 26 May 2008, 19:47 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 08 October 2008, 07:38 GMT
Opened by Daniel Rammelt (shazeal) - Monday, 26 May 2008, 19:47 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 08 October 2008, 07:38 GMT
|
Details
Description: The default CFS I/O scheduler options in the
kernel essentially cause the system to halt for disk I/O
operations due to the way CFS handles root processes. CFS
assigns the majority of the I/O slices to root and forgets
about the user, causing the system to become unresponsive
until disk I/O has ceased. While same disk transfers leave
the system sluggish with intermittent pauses.
This problem was not readily apparent in the i686 kernel and was only noticed when changing to the x86_64 Arch. Similar behavior has been noted in both Gentoo and Ubuntu see links below. The problem is solved by enabling CONFIG_CGROUP_SCHED see diff attached. Additional info: Reproduced on... - kernel26-2.6.25.4 (Stock Arch) - zen-kernel26-2.6.25-zen2 (Using Arch config) - vanilla-kernel-2.6.25.4 (Using Arch config) Solved by... - kernel26-2.6.25-4 (Stock arch config + attached diff) - zen-kernel26-2.6.25-zen2 (Using BFQ I/O scheduler + Stock arch config) http://forums.gentoo.org/viewtopic-t-482731-highlight-disk+raid+amd64.html https://bugs.launchpad.net/ubuntu/+source/linux/+bug/188226 Steps to reproduce: Use stock Arch x86_64 kernel and transfer large amounts of data from disk -> disk, or same disk large file transfers. |
This task depends upon
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_CGROUP_SCHED=y
And that's causing again latency issues (as expected). So how to revert to the pre-group scheduler behavior and avoid the problem completely? Anyone knows? Do we need to enable CGROUP but disable GROUP?
I am using x86_64 myself and haven't seen any problems with disk I/O.
The original poster is confusing CFS (the CPU scheduler) and CFQ (the I/O scheduler). Apparently he has a problem with CFQ, not with CFS. Now, he has found two solutions:
- Change CFQ for BFQ (BFQ is not in mainline, I wonder if changing to anticipatory would also solve his problem)
- Enable a new feature appeared in 2.6.25 called CGROUPS
So, if I understand correctly, the problem with I/O should exist *before* 2.6.25 and has nothing to do with the CFS scheduler. It's only that the CGROUPS feature seems to solve it (though it's just a workaround for the real bug in CFQ). Is this correct?
Now, regarding the group scheduler in CFS, it is known and warned by developers that it has a price regarding latency. To disable it and get the exact 2.6.24 behavior we should not set CONFIG_GROUP_SCHED. This is what it was done in 2.6.25 and the latency problems were solved. But then this confusing report has raised some doubts. Could the original reporter clarify the situation? Did the problem exist before 2.6.25? Does it go away by changing CFQ for anticipatory I/O scheduler ("echo anticipatory > /sys/block/{DEVICE-NAME}/queue/scheduler")?
Thanks.
The original report says that with that config and changing the I/O scheduler to BFQ the problem was solved, so it really seems that his problem is with the CFQ I/O scheduler. I don't think that enabling CGROUPS in the CPU scheduler to workaround a bug in the I/O scheduler is the right approach, even if it happens to work.
At least this is my opinion with the given facts.
I wont argue that its a great fix because its not, this issue has been on going since 2.6.19. I have recently switched to an Intel platform and the issue is non existant (previously nforce/amd), it is also non existant on i686 using exactly the same kernel config (on the nforce/amd build). So I get the feeling the issue lies somewhere in the kernel core. That said I still use CGROUPS as it stops background tasks running as root stealing CPU time from my foreground applications.
I guess that the best thing to get a real fix would be to report this upstream. As a workaround (as long as enabling CGROUPS is a better solution for you than just switching to anticipatory scheduler), maybe we could try enabling CGROUPS but disabling GROUP_SCHED and see if that solves your problem without hurting latency for other users?
I assume this is not the normal behavior.
So I think this lag is normal behavior due to high IO activity on the same drive as the root(/). Not going to lie though, Windows Vista IO Scheduler provides better interactivity than the CFQ in mainline. I guess this behavior will improve as the mainline CPU and IO schedulers mature.
Sorry for re-opening this.
However, you might want to try the anticipatory I/O scheduler instead of CFQ. It works much better for some people. You can change it on the fly with the command "echo anticipatory > /sys/block/{DEVICE-NAME}/queue/scheduler" (the device name should be sda, sdb, etc...) or at boot time by adding "elevator=as" to your kernel line in /boot/grub/menu.lst