Hi,
As per the description, BFQ is touted as a low-latency scheduler for
interactivity.
The website described it as:
Low latency for interactive applications
According to our results, whatever the background load is, for interactive tasks
the storage device is virtually as responsive as if it was idle. For example,
even if one or more of the following background workloads are being served in
parallel:
* one or more large files are being read or written,
* a tree of source files is being compiled,
* one or more virtual machines are performing I/O,
* a software update is in progress,
* indexing daemons are scanning the filesystems and updating their databases,
The above description covers reads as well as *writes*. But on some of the demo
videos I saw online, IIRC it only demonstrated about the read scenarios.
Hence, I'm writing here with some details about my write use case. It sure is an
exceptional case, but I think it shouldn't qualify as a corner case.
Machine:
Intel Haswell - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
RAM - 8 GiB
Swap - 8 GiB
rrs@chutzpah:~$ free -m
total used free shared buff/cache available
Mem: 7387 1554 155 169 5678 5379
Swap: 8579 268 8311
Disk
Rotational Disk, with rootfs fully encrypted with dm-crypt (CPU does have crypt
extensions)
rrs@chutzpah:~$ fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xa5703559
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 6146047 6144000 3G 83 Linux
/dev/sda2 6146048 419432447 413286400 197.1G 8e Linux LVM
/dev/sda3 * 419432448 421386239 1953792 954M 83 Linux
/dev/sda4 421388286 976771071 555382786 264.8G 5 Extended
/dev/sda5 421388288 976771071 555382784 264.8G 83 Linux
With just a single I/O thread of dd, I have been able to always bring the
machine to a hung state. The only clean exit is to let it be as is, and the I/O
thread to complete. Upon completion, the kernel is capable of recovering.
Point to keep in mind, in this case, is:
* Single I/O thread
* Ensure that you write data more than your full RAM capacity
Command run: dd if=/dev/zero of=/tmp/foo.img bs=1M count=10000 conv=fsync;
With the above command running, as soon as the memory gets full, the OS goes
into a hung state. It does recover but I'm sure I can make it thrash further if
I increase the number of processes contending for I/O.
Note: The catch is to pump total I/O, which is more than the amount of physical
RAM you have. So, in above example, I chose 10000 MiB because I have around 8
GiB of physical RAM.
Attached is the dmesg log, where the kernel went haywire, once the I/O and
Memory pressure increased.
I was hoping that BFQ was capable of improving such scenarios. But I was able to
make the kernel stall, maybe not as bad as CFQ, but still it stalled. IIRC, cfq
used to completely thrash for hours, under this test.
So, is this test valid ? If so, can BFQ be improved to tackle this scenario?
Maybe other BFQ users could try the above scenario and share their results. Keep
in mind that the issue is quickly reproducible on rotational backing device, but
I've also been able to reproduce it on SSDs.
--
Ritesh Raj Sarraf
RESEARCHUT -
http://www.researchut.com
"Necessity is the mother of invention."