The patch titled Restore MADV_DONTNEED to its original Linux behaviour has been removed from the -mm tree. Its filename was restore-madv_dontneed-to-its-original-linux-behaviour.patch This patch was dropped because it was withdrawn ------------------------------------------------------ Subject: Restore MADV_DONTNEED to its original Linux behaviour From: Rik van Riel <riel@xxxxxxxxxx> Restore MADV_DONTNEED to its original Linux behaviour. This is still not the same behaviour as POSIX, but applications may be depending on the Linux behaviour already. Besides, glibc catches POSIX_MADV_DONTNEED and makes sure nothing is done... Signed-off-by: Rik van Riel <riel@xxxxxxxxxx> Cc: Hugh Dickins <hugh@xxxxxxxxxxx> Cc: Michael Kerrisk <mtk-manpages@xxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Ulrich Drepper <drepper@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/madvise.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff -puN mm/madvise.c~restore-madv_dontneed-to-its-original-linux-behaviour mm/madvise.c --- a/mm/madvise.c~restore-madv_dontneed-to-its-original-linux-behaviour +++ a/mm/madvise.c @@ -150,7 +150,8 @@ static long madvise_willneed(struct vm_a */ static long madvise_dontneed(struct vm_area_struct * vma, struct vm_area_struct ** prev, - unsigned long start, unsigned long end) + unsigned long start, unsigned long end, + int behavior) { *prev = vma; if (vma->vm_flags & (VM_LOCKED|VM_HUGETLB|VM_PFNMAP)) @@ -162,12 +163,14 @@ static long madvise_dontneed(struct vm_a .last_index = ULONG_MAX, }; zap_page_range(vma, start, end - start, &details); - } else { + } else if (behavior == MADV_FREE) { struct zap_details details = { .madv_free = 1, }; zap_page_range(vma, start, end - start, &details); - } + } else /* behavior == MADV_DONTNEED */ + zap_page_range(vma, start, end - start, NULL); + return 0; } @@ -239,10 +242,9 @@ madvise_vma(struct vm_area_struct *vma, error = madvise_willneed(vma, prev, start, end); break; - /* FIXME: POSIX says that MADV_DONTNEED cannot throw away data. */ case MADV_DONTNEED: case MADV_FREE: - error = madvise_dontneed(vma, prev, start, end); + error = madvise_dontneed(vma, prev, start, end, behavior); break; default: _ Patches currently in -mm which might be from riel@xxxxxxxxxx are vmscan-give-referenced-active-and-unmapped-pages-a-second-trip-around-the-lru.patch restore-madv_dontneed-to-its-original-linux-behaviour.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html