Re: [RFC Patch] fs: implement per-file drop caches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(5/31/12 2:20 AM), Cong Wang wrote:
On Wed, 2012-05-30 at 16:14 +0100, Pádraig Brady wrote:
On 05/30/2012 02:38 PM, Cong Wang wrote:
This is a draft patch of implementing per-file drop caches.

It introduces a new fcntl command  F_DROP_CACHES to drop
file caches of a specific file. The reason is that currently
we only have a system-wide drop caches interface, it could
cause system-wide performance down if we drop all page caches
when we actually want to drop the caches of some huge file.

This is useful functionality.
Though isn't it already provided with POSIX_FADV_DONTNEED?

Thanks for teaching this!

However, from the source code of madvise_dontneed() it looks like it is
using a totally different way to drop page caches, that is to invalidate
the page mapping, and trigger a re-mapping of the file pages after a
page fault. So, yeah, this could probably drop the page caches too (I am
not so sure, haven't checked the code in details), but with my patch, it
flushes the page caches directly, what's more, it can also prune
dcache/icache of the file.

madvise should work. I don't think we need duplicate interface. Moreomover
madvise(2) is cleaner than fcntl(2).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]