From: Andrea Righi <andrea@betterlinux.com>
To: "Patrick J. LoPresti" <lopresti@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE
Date: Wed, 13 Jul 2011 00:22:27 +0200 [thread overview]
Message-ID: <20110712222227.GA1316@thinkpad> (raw)
In-Reply-To: <8762n7kvym.fsf@cmungerjr.com>
On Tue, Jul 12, 2011 at 02:52:49PM -0700, Patrick J. LoPresti wrote:
>
> > IIUC, NOREUSE means "the application will use this range of the file
> > once". It's something that we do _before_ accessing the file. And the
> > kernel needs to remember the ranges of NOREUSE data for each file, so
> > that page cache can be immediately dropped after the data has been
> > accessed (if possible).
>
> I am no expert on the Linux page cache, but my applications have a great
> interest in exercising some control over it...
>
> Could NOREUSE be as simple as setting a bit on the page that means
> "never mark this page active"?
>
> Or more conservatively, "clear this bit before marking the page active"?
>
> So POSIX_FADV_NOREUSE would set the bit on the page. Then any operation
> that would normally mark the page active would instead merely clear the
> bit. This would keep the page on the inactive list _after_ the first
> read and allow it to be reclaimed, which is at least in the "spirit" of
> NOREUSE.
If the file data is not in memory you can't set a bit in any struct
page. You could even open a file and execute POSIX_FADV_NOREUSE without
reading any page from the file.
I think it would be better to maintain a list of file offset/length
structures per file descriptor or (as a starting solution) even mark the
entire file as non-cacheable without considering the ranges.
-Andrea
next prev parent reply other threads:[~2011-07-12 22:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 13:49 [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE Andrea Righi
2011-06-24 13:49 ` [PATCH v3 1/2] mm: introduce __invalidate_mapping_pages() Andrea Righi
2011-06-26 22:46 ` Rik van Riel
2011-06-27 7:05 ` Andrea Righi
2011-06-24 13:49 ` [PATCH v3 2/2] fadvise: implement POSIX_FADV_NOREUSE Andrea Righi
2011-06-26 22:47 ` Rik van Riel
2011-06-27 7:05 ` Andrea Righi
2011-06-27 3:04 ` [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE KOSAKI Motohiro
2011-06-27 7:11 ` Andrea Righi
2011-06-27 7:42 ` KOSAKI Motohiro
2011-06-27 10:17 ` Pádraig Brady
2011-06-27 10:29 ` Andrea Righi
2011-06-27 11:53 ` Pádraig Brady
2011-06-27 12:39 ` Andrea Righi
2011-07-12 21:52 ` Patrick J. LoPresti
2011-07-12 22:22 ` Andrea Righi [this message]
2011-07-13 0:36 ` Patrick J. LoPresti
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=20110712222227.GA1316@thinkpad \
--to=andrea@betterlinux.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lopresti@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