From: Dave Chinner <david@fromorbit.com>
To: Nick White <nwhite@palantir.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] procfs: expose page cache contents
Date: Fri, 26 Apr 2013 10:47:08 +1000 [thread overview]
Message-ID: <20130426004708.GU30622@dastard> (raw)
In-Reply-To: <1F4A5D0CEBD3124E92D83D35F27C0734017A3B60@EX02-EAST.YOJOE.local>
On Thu, Apr 25, 2013 at 02:27:10PM +0000, Nick White wrote:
> From: Nick White <nwhite@palantir.com>
>
> This patch adds a /proc/page_cache file to the procfs. The file contains a
> line for each inode belonging to a block filesystem which has one or more
> of its pages in memory (as determined by PageUptodate). This line includes
> a run-length-encoded bitmap of which pages are up-to-date, starting with
> pages that aren't (so a string 0,4,2,3 means the first four pages are
> up-to-date, the next two aren't and the final three are).
>
> A sample output (columns are inode, super block id, total number of pages
> for this inode, run-length-encoded bitmap of which pages are up-to-date,
> total pages up-to-date, total pages not up-to-date):
>
> 148073 sda1 1 0,1 1 0
> 397793 sda1 4518 0,3,2,1,67,32,231,1,29,2,396,9,32,1,12,2,2613,1,1084 52 44
> 66
> 133941 sda1 13 0,4,3,3,3 7 6
> 173947 sda1 43 0,5,2,1,1,4,1,1,2,1,8,6,1,10 28 15
> 148499 sda1 4 0,4 4 0
>
> It's currently possible to query this information for a specific file from
> userspace using mmap / mincore system calls, however this patch solves the
> slightly different question "What's in the cache?" (not "Is this in the
> cache?").
Leaving aside the implementation problems in your patch (and there
are lots of them), what use does this information have?
It's out of date by the time the caller can make any sense of it,
and there's nothing the caller can do with the information, anyway.
Indeed, the act of dumping this information and storing/parsing it
in userspace will generate memory pressure and perturb the very
thing you are trying to measure....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2013-04-26 0:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 14:27 [PATCH] procfs: expose page cache contents Nick White
2013-04-26 0:47 ` Dave Chinner [this message]
2013-04-28 0:05 ` Nick White
2013-04-29 1:38 ` Dave Chinner
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=20130426004708.GU30622@dastard \
--to=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nwhite@palantir.com \
--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).