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


Groups > linux.kernel > #1587235

Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list
Date 2017-02-24 03:00 +0100
Message-ID <tedkR-1ou-5@gated-at.bofh.it> (permalink)
References <tdKiR-62X-7@gated-at.bofh.it> <tdKiS-62X-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Feb 22, 2017 at 10:50:41AM -0800, Shaohua Li wrote:
> madv MADV_FREE indicate pages are 'lazyfree'. They are still anonymous
> pages, but they can be freed without pageout. To destinguish them
> against normal anonymous pages, we clear their SwapBacked flag.
> 
> MADV_FREE pages could be freed without pageout, so they pretty much like
> used once file pages. For such pages, we'd like to reclaim them once
> there is memory pressure. Also it might be unfair reclaiming MADV_FREE
> pages always before used once file pages and we definitively want to
> reclaim the pages before other anonymous and file pages.
> 
> To speed up MADV_FREE pages reclaim, we put the pages into
> LRU_INACTIVE_FILE list. The rationale is LRU_INACTIVE_FILE list is tiny
> nowadays and should be full of used once file pages. Reclaiming
> MADV_FREE pages will not have much interfere of anonymous and active
> file pages. And the inactive file pages and MADV_FREE pages will be
> reclaimed according to their age, so we don't reclaim too many MADV_FREE
> pages too. Putting the MADV_FREE pages into LRU_INACTIVE_FILE_LIST also
> means we can reclaim the pages without swap support. This idea is
> suggested by Johannes.
> 
> This patch doesn't move MADV_FREE pages to LRU_INACTIVE_FILE list yet to
> avoid bisect failure, next patch will do it.
> 
> The patch is based on Minchan's original patch.
> 
> 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>
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
> Signed-off-by: Shaohua Li <shli@fb.com>

Other than that Johannes pointed out, code itself looks good to me.
However, I hope to merge this patch with next one.
It's enough simple to merge, change behavior(about deactivation),
mark_page_lazyfree is introduced but there is no callsite to use it
in this patch.

I don't think it's worth to separate.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V4 0/6] mm: fix some MADV_FREE issues Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
    Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 17:10 +0100
      Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 20:00 +0100
    Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Minchan Kim <minchan@kernel.org> - 2017-02-24 03:00 +0100
      Re: [PATCH V4 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE  list Minchan Kim <minchan@kernel.org> - 2017-02-25 00:40 +0100
  [PATCH V4 5/6] mm: enable MADV_FREE for swapless system Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 2/6] mm: don't assume anonymous pages have SwapBacked flag Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
  [PATCH V4 4/6] mm: reclaim MADV_FREE pages Shaohua Li <shli@fb.com> - 2017-02-22 20:00 +0100
    Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Johannes Weiner <hannes@cmpxchg.org> - 2017-02-23 17:20 +0100
    Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Minchan Kim <minchan@kernel.org> - 2017-02-24 03:20 +0100
      Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Johannes Weiner <hannes@cmpxchg.org> - 2017-02-24 16:50 +0100
        Re: [PATCH V4 4/6] mm: reclaim MADV_FREE pages Minchan Kim <minchan@kernel.org> - 2017-02-25 00:30 +0100

csiph-web