1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-14 15:21:37 +03:00
systemd/src/readahead
Auke Kok 94243ef299 readahead: chunk on spinning media
Readahead has all sorts of bad side effects depending on your
storage media. On rotating disks, it may be degrading startup
performance if enough requests are queued spanning linearly
over all blocks early at boot, and mount, blkid and friends
want to insert reads to the start of these block devices after.

The end result is that on spinning disks with ext3/4 that udev
and mounts take a very long time, and nothing really happens until
readahead is completely finished.

This has the net effect that the CPU is almost entirely idle
for the entire period that readahead is working. We could have
finished starting up quite a lot of services in this time if
we were smarter at how we do readahead.

This patch sorts all requests into 2 second "chunks" and sub-sorts
each chunk by block. This adds a single cross-drive seek per "chunk"
but has the benefit that we will have a lot of the blocks we need
early on in the boot sequence loaded into memory faster.

For a comparison of how before/after bootcharts look (ext4 on a
mobile 5400rpm 250GB drive) please look at:

    http://foo-projects.org/~sofar/blocked-tests/

There are bootcharts in the "before" and "after" folders where you
should be able to see that many low-level services finish 5-7
seconds earlier with the patch applied (after).
2013-03-26 10:32:32 -07:00
..
Makefile
readahead-analyze.c
readahead-collect.c readahead: chunk on spinning media 2013-03-26 10:32:32 -07:00
readahead-common.c honor SELinux labels, when creating and writing config files 2013-02-14 16:19:38 +01:00
readahead-common.h
readahead-replay.c readahead: don't complain that we cannot precache symlinks 2013-01-03 22:37:38 +01:00
readahead.c
sd-readahead.c Remove or indent #define GNU_SOURCE 2013-03-11 18:03:13 -04:00