lkml.org 
[lkml]   [2007]   [Jan]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 28 Jan 2007 12:38:31 +0530
FromVaidyanathan Srinivasan <>
SubjectRe: [PATCH] drop page cache of a single file

Zhang, Yanmin wrote:
> Currently, by /proc/sys/vm/drop_caches, applications could drop pagecache,
> slab(dentries and inodes), or both, but applications couldn't choose to
> just drop the page cache of one file. An user of VOD (Video-On-Demand)
> needs this capability to have more detailed control on page cache release.
> 
> Below patch against 2.6.19 implements it.
> 
> Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
> 
> ---
> 
> diff -Nraup linux-2.6.19/Documentation/filesystems/proc.txt linux-2.6.19_dropcache/Documentation/filesystems/proc.txt
> --- linux-2.6.19/Documentation/filesystems/proc.txt	2006-12-08 15:32:44.000000000 +0800
> +++ linux-2.6.19_dropcache/Documentation/filesystems/proc.txt	2006-12-28 10:20:39.000000000 +0800
> @@ -1320,6 +1320,8 @@ To free dentries and inodes:
>  	echo 2 > /proc/sys/vm/drop_caches
>  To free pagecache, dentries and inodes:
>  	echo 3 > /proc/sys/vm/drop_caches
> +To free the pagecache of one file:
> +	echo "4 /path/to/filename" > /proc/sys/vm/drop_caches
> 
>  As this is a non-destructive operation and dirty objects are not freeable, the
>  user should run `sync' first.

"sync" is the most time consuming operation.  Clean pagecache pages
are immediately reclaimable... they are actually free pages.  Writing
out dirty pages consumes time.

Hence this approach may not provide the required performance benefits
since only clean pagecache pages are marked free.  fadvise approach
would provide similar behavior.

--Vaidy

[snip]

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

\
 
 \ /
  Last update: 2007-01-28 08:13    [from the cache]
©2003-2008