On 21/04/07 09:18PM, Matthew Wilcox (Oracle) wrote: > As requested, fix up readahead_expand() so as to not confuse the ondemand > algorithm. Also make the documentation slightly better. Dave, could you > put in some debug and check this actually works? I don't generally test > with any filesystems that use readahead_expand(), but printing (index, > nr_to_read, lookahead_size) in page_cache_ra_unbounded() would let a human > (such as your good self) determine whether it's working approximately > as designed. Hello, Sorry about the silly question here, since I don't have much details of how readahead algorithm code path. 1. Do we know of a way to measure efficiency of readahead in Linux? 2. And if there is any way to validate readahead is working correctly and as intended in Linux? Like is there anything designed already to measure above two things? If not, are there any stats which can be collected and later should be parsed to say how efficient readahead is working in different use cases and also can verify if it's working correctly? I guess, we can already do point 1 from below. What about point 2 & 3? 1. Turn on/off the readahead and measure file reads timings for different patterns. - I guess this is already doable. 2. Collecting runtime histogram showing how readahead window is increasing/decreasing based on changing read patterns. And collecting how much IOs it takes to increase/decrease the readahead size. Are there any tracepoints needed to be enabled for this? 3. I guess it won't be possible w/o a way to also measure page cache efficiency. Like in case of a memory pressure, if the page which was read using readahead is thrown out only to re-read it again. So a way to measure page cache efficiency also will be required. Any idea from others on this? I do see below page[1] by Brendan showing some ways to measure page cache efficiency using cachestat. But there are also some problems mentioned in the conclusion section, which I am not sure of what is the latest state of that. Also it doesn't discusses much on the readahead efficiency measurement. [1]: http://www.brendangregg.com/blog/2014-12-31/linux-page-cache-hit-ratio.html