2011/3/28 Lennart Poettering <lenn...@poettering.net>: > On Sun, 20.03.11 05:28, fykc...@gmail.com (fykc...@gmail.com) wrote: >> Current readahead implementation has some problems: >> 1. It can't separate *real* block read requests from all read >> requests(which includes more blocks read by the kernel's readahead >> logic) > > Shouldn't make a big difference, since on replay we turn off additional > kernel-side readahead. > > However, it is true that the file will only ever increase, never > decrease in size. For collect, it can't filter out: 1. Kernel-side readahead, whether the readahead is initiated by kernel(when no /.readhead data), or the replay process. 2. Written blocks of files(opened as "r+", "w+", "a"). The written blocks resides at memory when boot time.
IMHO, the kernel lacks some APIs to notify each *real* read requests. e.g, It can be done by tracking each read syscall (mmap seems not easy to handle, though). > >> 2. It just gives advices for how to do kernel's readahead, causes the >> first read of a fille to spend more time. > > Hmm? posix_fadvise(...) may make each read do more readahead(more than the kernel guess way), thus spend more time. e.g. * When no replay, someone reads A part of file X --> do some job --> reads B part of file X. * When replay, both A and B parts of file X are read in one time, thus more I/O usage. Other services may spend more time waiting for I/O.(This can be observed from bootchart diagram) BTW, does posix_fadvise apply globally or just for the process which calls it? > > We do that too. We use "idle" on SSD, and "realtime" on HDD. Why "realtime" on HDD? BTW, According to test, the "idle" is not really *idle*, see the attachment. That means 'replay' will always impact other one's I/O. For 'replay' in idle I/O class on HDD, other one's I/O performance will reduce by half, according to the test. -- Regards, - cee1
<<attachment: effect_of_IO_IDLE.png>>
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel