Thread (1 message) 1 message, 1 author, 2011-04-29

Re: [RFC] [PATCH] drop_pagecache syscall

From: Andrea Righi <hidden>
Date: 2011-04-29 08:18:32
Also in: linux-fsdevel, lkml

On Thu, Apr 28, 2011 at 04:22:10PM -0700, Joel Becker wrote:
On Wed, Apr 27, 2011 at 11:01:28AM +0200, Andrea Righi wrote:
quoted
On Wed, Apr 27, 2011 at 10:14:53AM +1000, Dave Chinner wrote:
quoted
On Tue, Apr 26, 2011 at 11:35:27PM +0200, Andrea Righi wrote:
quoted
Introduce sys_drop_pagecache() system call to drop the page cache pages of
a single filesystem.
<snip>
quoted
quoted
quoted
This functionality can be used by all the applications that want to have a
better control over the page cache management (for example to immediately drop
pages that for sure will not be reused in the near future, without calling
posix_fadvise() for all the files they've touched), or to provide a more fine
grained debugging feature usable by the filesystem benchmarks.

The system call does not require root privileges and it can be called by any
unprivileged application. For example, we can write a userspace tool to run
something like this:

  $ drop-pagecache /path/file_or_dir
That's a potential DOS vector, I think. Drop the pagecache in a hard
loop on the root fs of a busy server and watch it crawl...
Yes, probably we could allow only the CAP_SYS_ADMIN tasks to execute
this syscall.
	The majority of apps that want this do not run as root.  Do we
want them all setuid?  ;-)
Another solution could be to limit the rate of this syscall if executed
by a non-privileged user. And the rate limit could be also configurable
from userspace via /proc/sys/vm/ or something similar.

-Andrea
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help