[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170210173303.GB86050@shli-mbp.local>
Date: Fri, 10 Feb 2017 09:33:04 -0800
From: Shaohua Li <shli@...com>
To: Michal Hocko <mhocko@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<Kernel-team@...com>, <danielmicay@...il.com>,
<minchan@...nel.org>, <hughd@...gle.com>, <hannes@...xchg.org>,
<riel@...hat.com>, <mgorman@...hsingularity.net>,
<akpm@...ux-foundation.org>
Subject: Re: [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@...e.com>
> > Cc: Minchan Kim <minchan@...nel.org>
> > Cc: Hugh Dickins <hughd@...gle.com>
> > Cc: Johannes Weiner <hannes@...xchg.org>
> > Cc: Rik van Riel <riel@...hat.com>
> > Cc: Mel Gorman <mgorman@...hsingularity.net>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
>
> I guess
> Suggested-by: Johannes Weiner <hannes@...xchg.org>
>
> would be appropriate.
Sure, will add in next post and will add 'the patches are based on Minchan's
patches' too.
Thanks,
Shaohua
Powered by blists - more mailing lists