From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbdB1DVy (ORCPT ); Mon, 27 Feb 2017 22:21:54 -0500 Received: from out4439.biz.mail.alibaba.com ([47.88.44.39]:28276 "EHLO out4439.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbdB1DVs (ORCPT ); Mon, 27 Feb 2017 22:21:48 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R591e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03295;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=11;SC=85;SR=0;TI=SMTPD_---.7ijsLI7_1488251971; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Shaohua Li'" , , Cc: , , , , , , , References: <2f87063c1e9354677b7618c647abde77b07561e5.1487965799.git.shli@fb.com> In-Reply-To: <2f87063c1e9354677b7618c647abde77b07561e5.1487965799.git.shli@fb.com> Subject: Re: [PATCH V5 3/6] mm: move MADV_FREE pages into LRU_INACTIVE_FILE list Date: Tue, 28 Feb 2017 11:19:31 +0800 Message-ID: <06ef01d29171$7ace0620$706a1260$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIuD9vBFeLkbhxOzv8ei/Ca5089rgJNkLLdoLRV7iA= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On February 25, 2017 5:32 AM 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 > Cc: Minchan Kim > Cc: Hugh Dickins > Cc: Rik van Riel > Cc: Mel Gorman > Cc: Andrew Morton > Suggested-by: Johannes Weiner > Signed-off-by: Shaohua Li > --- Acked-by: Hillf Danton