lkml.org 
[lkml]   [2017]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH V2 4/7] mm: enable MADV_FREE for swapless system
    Date
    Now MADV_FREE pages can be easily reclaimed even for swapless system. We
    can safely enable MADV_FREE for all systems.

    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Shaohua Li <shli@fb.com>
    ---
    mm/madvise.c | 8 +-------
    1 file changed, 1 insertion(+), 7 deletions(-)

    diff --git a/mm/madvise.c b/mm/madvise.c
    index c24549e..fe40e93 100644
    --- a/mm/madvise.c
    +++ b/mm/madvise.c
    @@ -579,13 +579,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
    case MADV_WILLNEED:
    return madvise_willneed(vma, prev, start, end);
    case MADV_FREE:
    - /*
    - * XXX: In this implementation, MADV_FREE works like
    - * MADV_DONTNEED on swapless system or full swap.
    - */
    - if (get_nr_swap_pages() > 0)
    - return madvise_free(vma, prev, start, end);
    - /* passthrough */
    + return madvise_free(vma, prev, start, end);
    case MADV_DONTNEED:
    return madvise_dontneed(vma, prev, start, end);
    default:
    --
    2.9.3
    \
     
     \ /
      Last update: 2017-02-04 00:35    [W:4.111 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site