LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drop page cache of a single file
Date: Sun, 28 Jan 2007 12:38:31 +0530	[thread overview]
Message-ID: <45BC4BEF.3040303@linux.vnet.ibm.com> (raw)
In-Reply-To: <1167275845.15989.153.camel@ymzhang>



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]


      parent reply	other threads:[~2007-01-28  7:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-28  3:17 Zhang, Yanmin
2006-12-28  3:49 ` Andrew Morton
     [not found]   ` <367290328.14058@ustc.edu.cn>
2006-12-28  7:19     ` Fengguang Wu
2006-12-28 10:29     ` Andrew Morton
2006-12-28 10:45       ` Russell King
2006-12-28 11:03         ` Andrew Morton
     [not found]       ` <367303459.19953@ustc.edu.cn>
2006-12-28 10:57         ` Fengguang Wu
2007-01-28  7:08 ` Vaidyanathan Srinivasan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45BC4BEF.3040303@linux.vnet.ibm.com \
    --to=svaidy@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yanmin_zhang@linux.intel.com \
    --subject='Re: [PATCH] drop page cache of a single file' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).