Re: [PATCH -mm] mm: more likely reclaim MADV_SEQUENTIAL mappings



On Tue, 22 Jul 2008 12:02:26 +1000
Nick Piggin <nickpiggin@xxxxxxxxxxxx> wrote:

I don't actually care what the man page or posix says if it is obviously
silly behaviour. If you want to dispute the technical points of my post,
that would be helpful.

Application writers read the man page and expect MADV_SEQUENTIAL
to do roughly what the name and description imply.

If you think that the kernel should not bother implementing
what the application writers expect, and the application writers
should implement special drop-behind magic for Linux, your
expectations may not be entirely realistic.

Consider this: if the app already has dedicated knowledge and
syscalls to know about this big sequential copy, then it should
go about doing it the *right* way and really get performance
improvement. Automatic unmap-behind even if it was perfect still
needs to scan LRU lists to reclaim.

Doing nothing _also_ ends up with the kernel scanning the
LRU lists, once memory fills up.

Scanning the LRU lists is a given.

All that the patch by Johannes does is make sure the kernel
does the right thing when it runs into an MADV_SEQUENTIAL
page on the inactive_file list: evict the page immediately,
instead of having it pass through the active list and the
inactive list again.

This reduces the number of times that MADV_SEQUENTIAL pages
get scanned from 3 to 1, while protecting the working set
from MADV_SEQUENTIAL pages.

--
All rights reversed.
--
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/



Relevant Pages

  • Re: [PATCH -mm] mm: more likely reclaim MADV_SEQUENTIAL mappings
    ... Application writers read the man page and expect MADV_SEQUENTIAL ... unmapping them than the kernel will ever be able to do itself. ... needs to scan LRU lists to reclaim. ... for the fact that the mapping will be accessed once, ...
    (Linux-Kernel)
  • Re: [PATCH -mm] mm: more likely reclaim MADV_SEQUENTIAL mappings
    ... Nick Piggin wrote: ... Application writers read the man page and expect MADV_SEQUENTIAL ... unmapping them than the kernel will ever be able to do itself. ... needs to scan LRU lists to reclaim. ...
    (Linux-Kernel)
  • Re: Kernel Panic
    ... downloads) It seems that the writers would have noticed that the OS wouldn't ... > Never seen a such message if the grub entry is wrong, ... > You will get a kernel panic if you need to use a module that isn't built ...
    (alt.linux)
  • Re: Lilo to Grub kills removables
    ... IDE CD writers are now supported as IDE CD writers with the 2.6 kernel and ... later versions of cdrecord. ...
    (alt.os.linux)