truncate_inode_pages problem

Submitted by itman
on March 10, 2004 - 11:29pm

Hi, all, perhaps it is better to address this message to a specific kernel forum but this seems to affect both 2.2 and 2.4. I am making benchmarks (in a very specific area) and want to clear cashes of some files. I do this by calling truncate_inode_pages inside a tiny driver. I know about O_DIRECT parameter in open function for kernel 2.4 and later but I want this to work with 2.2 too.

A problem: this works poorly with a "recently" created file. After creating and closing a file truncate_inode_pages does not clear all linux cashes! However after rebooting a PC (and I suppose after remounting a partition) all cashes are cleared all right.

and a bit more information:

itman
on
March 10, 2004 - 11:34pm

and a bit more information:
looking at kernel sources I see that truncate_inode_pages as well as vmtruncate DO clears inode cashes. So it is an interesting question what are these additional cashes allocated when the file is created.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.