linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Cong Wang <amwang@redhat.com>
Cc: "Pádraig Brady" <P@draigBrady.com>,
	linux-kernel@vger.kernel.org,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Cong Wang" <xiyou.wangcong@gmail.com>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Matthew Wilcox" <matthew@wil.cx>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	kosaki.motohiro@gmail.com
Subject: Re: [RFC Patch] fs: implement per-file drop caches
Date: Thu, 31 May 2012 02:30:22 -0400	[thread overview]
Message-ID: <4FC70FFE.50809@gmail.com> (raw)
In-Reply-To: <1338445233.19369.21.camel@cr0>

(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@kvack.org.  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@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-05-31  6:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30 13:38 [RFC Patch] fs: implement per-file drop caches Cong Wang
2012-05-30 15:12 ` John Stoffel
2012-05-31  6:28   ` Cong Wang
2012-05-30 15:14 ` Pádraig Brady
2012-05-31  6:20   ` Cong Wang
2012-05-31  6:30     ` KOSAKI Motohiro [this message]
2012-05-31 12:11       ` Cong Wang
2012-05-31 19:09         ` KOSAKI Motohiro
2012-06-01 11:32           ` Cong Wang
2012-06-01 13:08             ` John Stoffel
2012-06-04  3:28               ` Cong Wang

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=4FC70FFE.50809@gmail.com \
    --to=kosaki.motohiro@gmail.com \
    --cc=P@draigBrady.com \
    --cc=akpm@linux-foundation.org \
    --cc=amwang@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew@wil.cx \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiyou.wangcong@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).