lkml.org 
[lkml]   [2017]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 5/6] mm: enable MADV_FREE for swapless system
On Fri 24-02-17 13:31:48, Shaohua Li wrote:
> 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: Rik van Riel <riel@redhat.com>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Shaohua Li <shli@fb.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
> mm/madvise.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 225af7d..5ab4b7b 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -612,13 +612,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
>

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2017-02-27 16:25    [W:0.607 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site