Re: [PATCH 01/02/RFC] implement a stat cache
From: David Kastrup <hidden>
Date: 2016-06-15 22:44:31
Linus Torvalds [off-list ref] writes:
So I do think your stat cache could be improved, but for the reasons I outlined I would much prefer to make it unimportant instead.
Using a cache for a single algorithmic task is probably a mistake: a cache tries to keep some data around on the assumption that it might get used. So it tends to either waste lots of memory or keep the wrong data. And the reloads increase with the size of the processed data. Using a sorted-traverse-and-merge algorithm instead never needs to reload data and relinquishes it as soon as it is no longer needed. A stat cache is fine for an operating system which has no clue about what access patterns to except next. But in this case, our application has the whole task outlines in advance, and it makes sense organizing it in the best manner. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum