From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119AbdB1DWp (ORCPT ); Mon, 27 Feb 2017 22:22:45 -0500 Received: from out0-146.mail.aliyun.com ([140.205.0.146]:43208 "EHLO out0-146.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547AbdB1DVu (ORCPT ); Mon, 27 Feb 2017 22:21:50 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R571e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03312;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=11;SC=85;SR=0;TI=SMTPD_---.7ij3ePx_1488252069; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Shaohua Li'" , , Cc: , , , , , , , References: <14b8eb1d3f6bf6cc492833f183ac8c304e560484.1487965799.git.shli@fb.com> In-Reply-To: <14b8eb1d3f6bf6cc492833f183ac8c304e560484.1487965799.git.shli@fb.com> Subject: Re: [PATCH V5 4/6] mm: reclaim MADV_FREE pages Date: Tue, 28 Feb 2017 11:21:09 +0800 Message-ID: <06f001d29171$b5469740$1fd3c5c0$@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/Ca5089rgIBrJjpoLa16hA= 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: > > When memory pressure is high, we free MADV_FREE pages. If the pages are > not dirty in pte, the pages could be freed immediately. Otherwise we > can't reclaim them. We put the pages back to anonumous LRU list (by > setting SwapBacked flag) and the pages will be reclaimed in normal > swapout way. > > We use normal page reclaim policy. Since MADV_FREE pages are put into > inactive file list, such pages and inactive file pages are reclaimed > according to their age. This is expected, because we don't want to > reclaim too many MADV_FREE pages before used once pages. > > Based on Minchan's original patch > > Cc: Michal Hocko > Cc: Minchan Kim > Cc: Hugh Dickins > Cc: Johannes Weiner > Cc: Rik van Riel > Cc: Mel Gorman > Cc: Andrew Morton > Signed-off-by: Shaohua Li > --- Acked-by: Hillf Danton