lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110712222227.GA1316@thinkpad>
Date:	Wed, 13 Jul 2011 00:22:27 +0200
From:	Andrea Righi <andrea@...terlinux.com>
To:	"Patrick J. LoPresti" <lopresti@...il.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH v3 0/2] fadvise: support POSIX_FADV_NOREUSE

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ