Messages in this thread | | | Date | Sun, 17 Feb 2013 17:51:12 -0500 | From | Johannes Weiner <> | Subject | Re: [patch 1/2] mm: fincore() |
| |
On Sat, Feb 16, 2013 at 02:53:43PM +1030, Rusty Russell wrote: > Andrew Morton <akpm@linux-foundation.org> writes: > > On Fri, 15 Feb 2013 18:13:04 -0500 > > Johannes Weiner <hannes@cmpxchg.org> wrote: > >> I dunno. The byte vector might not be optimal but its worst cases > >> seem more attractive, is just as extensible, and dead simple to use. > > > > But I think "which pages from this 4TB file are in core" will not be an > > uncommon usage, and writing a gig of memory to find three pages is just > > awful. > > Actually, I don't know of any usage for this call. > > I'd really like to use it for backup programs, so they stop pulling > random crap into memory (but leave things already resident). But that > needs to madvise(MADV_DONTNEED) on the page, so need mmap.
We do actually have fadvise() (posix_fadvise()).
Btw, why are we not invalidating page cache from MADV_DONTNEED? I just see a page table teardown in there, so mmap for madvise alone won't do any good. fadvise() OTOTH /does/ invalidate page cache.
| |