From: Andrea Righi <andrea@betterlinux.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Dave Chinner <david@fromorbit.com>,
Al Viro <viro@zeniv.linux.org.uk>, Arnd Bergmann <arnd@arndb.de>,
linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] fadvise: introduce POSIX_FADV_DONTNEED_FS
Date: Thu, 28 Apr 2011 11:35:42 +0200 [thread overview]
Message-ID: <20110428093542.GB2517@linux.develer.com> (raw)
In-Reply-To: <BANLkTinG+ooNRH-VUjKdaHixbGCwk5XoXA@mail.gmail.com>
On Wed, Apr 27, 2011 at 02:25:17PM -0400, Mike Frysinger wrote:
> On Wed, Apr 27, 2011 at 14:13, Andrea Righi wrote:
> > Introduce a new fadvise flag to drop page cache pages of a single
> > filesystem.
> >
> > At the moment it is possible to drop page cache pages via
> > /proc/sys/vm/drop_pagecache or via posix_fadvise(POSIX_FADV_DONTNEED).
> >
> > The first method drops the whole page cache while the second can be used
> > to drop page cache pages of a single file descriptor. However, there's
> > not a simple way to drop all the pages of a filesystem (we could scan
> > all the file descriptors and use posix_fadvise(POSIX_FADV_DONTNEED), but
> > this solution obviously doesn't scale well).
>
> what if you open the mount point and use POSIX_FADV_DONTNEED on that
> dir handle ? if you required write access for that level, it'd also
> implicitly take care of the permission issue. but maybe this is just
> trying to fit existing code in the wrong way.
> -mike
I still prefer the capability check. I think it's much more simple from
the userspace point of view to be able to specify any file or directory
instead of being forced to retrieve the mountpoint.
However, an advantage with the approach you're proposing is that a
non-privileged user can drop the page cache of a filesystem if it has
write permission in the root of that filesystem.
mmmh.. I don't see big problems also with the interface you propose, if
you all think it's better I can implement this in the next version.
Thanks,
-Andrea
next prev parent reply other threads:[~2011-04-28 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 18:13 [PATCH v2] fadvise: introduce POSIX_FADV_DONTNEED_FS Andrea Righi
[not found] ` <1303928027-5100-1-git-send-email-andrea-oIIqvOZpAevzfdHfmsDf5w@public.gmane.org>
2011-04-27 18:25 ` Mike Frysinger
2011-04-28 9:35 ` Andrea Righi [this message]
2011-04-27 18:33 ` Matthew Wilcox
[not found] ` <20110427183308.GA16716-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2011-04-27 18:39 ` Mike Frysinger
2011-04-27 18:47 ` Matthew Wilcox
[not found] ` <20110427184756.GB16716-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2011-04-27 18:49 ` Mike Frysinger
2011-04-28 9:29 ` Andrea Righi
2011-05-04 21:44 ` Andrew Morton
[not found] ` <20110504144411.7f32c00c.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-05-04 22:09 ` Andrea Righi
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=20110428093542.GB2517@linux.develer.com \
--to=andrea@betterlinux.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=david@fromorbit.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vapier@gentoo.org \
--cc=viro@zeniv.linux.org.uk \
/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).