lkml.org 
[lkml]   [2017]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 2/7] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list
On Fri, Feb 10, 2017 at 02:02:36PM +0100, Michal Hocko wrote:
> On Fri 03-02-17 15:33:18, Shaohua Li wrote:
> > Userspace indicates MADV_FREE pages could be freed without pageout, so
> > it pretty much likes 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.
> >
> > We also clear the pages SwapBacked flag to indicate they are MADV_FREE
> > pages.
>
> I like this. I have expected this to be more convoluted but it looks
> quite straightforward. I didn't get to do a really deep review and add
> my acked-by but from a quick look there do not seem to be any surprises.
> I was worried about vmstat accounting. There are some places which
> isolate page from LRU and account based on the LRU and later use
> page_is_file_cache to tell which LRU this was. This should work fine,
> though, because you never touch pages which are off-lru.
>
> That being said I do not see any major issues. There might be some minor
> things and this will need a lot of testing but it is definitely a move
> into right direction. I hope to do the deeper review after I get back
> from vacation (20th Feb).

Sweat! Thanks for your time!
> > 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>
>
> I guess
> Suggested-by: Johannes Weiner <hannes@cmpxchg.org>
>
> would be appropriate.

Sure, will add in next post and will add 'the patches are based on Minchan's
patches' too.

Thanks,
Shaohua

\
 
 \ /
  Last update: 2017-02-10 20:06    [W:0.116 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site