On Wed, Apr 02 2008, Zhang, Yanmin wrote:
> Jens,
>
> I have a sync read testing with fio. Parameter loops=3 means
> repeating the read for 3 times. I want to invalidate the page cache
> before the testing, but keep cache among the loops.
>
> If the files already exist before testing, I could drop cache by
> /proc/sys/vm/drop_caches. But if the files don't exist, fio will create
> them. So if I set invalidate=0, the cache will be kept before the real testing.
>
> Is it possible to drop file cache in function extend_file if the file is
> extended? I mean, just drop the extended length?

I think it's a good idea to drop the extended length by default, that
way the cache state is identical to next time that job is run. I've
committed such a change, diff is below.