Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE

From: Patrick J. LoPresti
Date: Tue Jul 12 2011 - 17:53:06 EST



> 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.

- Pat
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/