Re: [RFC] the /proc/filecache interface

From: Fengguang Wu
Date: Wed Jun 14 2006 - 20:39:03 EST


Hi Bernard,

On Wed, Jun 14, 2006 at 11:38:37PM +0800, Bernard Blackham wrote:
> I haven't been following this closely, so I apologise if I'm out of
> my depth. It would be a useful add-on to be able to use this
> interface to force something _out_ of the page cache also. For
> example, for performance tests, or selectively ditching pages before
> software suspending.

Sure we can add more related commands into it.

For example, the functions in fs/drop_caches.c are well suited for
this interface. The current sysctl interface is a quick hacking:

/* A global variable is a bit ugly, but it keeps the code simple */
int sysctl_drop_caches;

The following scheme may be more reasonable:

# echo -n "drop files" > /proc/filecache
# echo -n "drop slabs" > /proc/filecache

As for the "selectively ditching pages" function, my original scheme
is to
- query /proc/filecache to answer the question of "which pages
are cached, and their status(referenced/active etc.)"
- run "fadvise filename page-offset pages" to ditch pages
Do you think it as convenient?

Thanks,
Wu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/