Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580778 > unrolled thread

[PATCH V3 4/7] mm: enable MADV_FREE for swapless system

Started byShaohua Li <shli@fb.com>
First post2017-02-14 20:40 +0100
Last post2017-02-17 17:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH V3 4/7] mm: enable MADV_FREE for swapless system Shaohua Li <shli@fb.com> - 2017-02-14 20:40 +0100
    Re: [PATCH V3 4/7] mm: enable MADV_FREE for swapless system Johannes Weiner <hannes@cmpxchg.org> - 2017-02-17 17:20 +0100

#1580778 — [PATCH V3 4/7] mm: enable MADV_FREE for swapless system

FromShaohua Li <shli@fb.com>
Date2017-02-14 20:40 +0100
Subject[PATCH V3 4/7] mm: enable MADV_FREE for swapless system
Message-ID<taR7b-5Vy-1@gated-at.bofh.it>
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 2faed38..851fabb 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -611,13 +611,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

[toc] | [next] | [standalone]


#1583562

FromJohannes Weiner <hannes@cmpxchg.org>
Date2017-02-17 17:20 +0100
Message-ID<tbTqh-6zb-5@gated-at.bofh.it>
In reply to#1580778
On Tue, Feb 14, 2017 at 11:36:10AM -0800, 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: 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>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web