Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbbHEAwQ (ORCPT ); Tue, 4 Aug 2015 20:52:16 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:42364 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbbHEAwO (ORCPT ); Tue, 4 Aug 2015 20:52:14 -0400 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 X-AuditID: cbfee690-f796f6d000005054-16-55c15e3cd595 Content-transfer-encoding: 8BIT Message-id: <55C15E37.80504@samsung.com> Date: Wed, 05 Aug 2015 09:52:07 +0900 From: Jaewon Kim User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 To: Minchan Kim , Andrew Morton Cc: mgorman@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, jaewon31.kim@gmail.com Subject: Re: [PATCH v2] vmscan: fix increasing nr_isolated incurred by putback unevictable pages References: <1438684808-12707-1-git-send-email-jaewon31.kim@samsung.com> <20150804150937.ee3b62257e77911a2f41a48e@linux-foundation.org> <20150804233108.GA662@bgram> In-reply-to: <20150804233108.GA662@bgram> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsVy+t8zTV2buIOhBou3yljMWb+GzaJ780xG i8u75rBZ3Fvzn9Vi8rtnjBbLvr5nd2Dz2DnrLrvHplWdbB6bPk1i9zgx4zeLx+bT1R6fN8kF sEVx2aSk5mSWpRbp2yVwZRz/PYm9YC1/xc15n5kbGDfzdDFyckgImEi8mL+BFcIWk7hwbz1b FyMXh5DASkaJh09bmGGKlh35zAJiCwnMYpS4uSAaxOYVEJT4MfkeUJyDg1lAXuLIpWyQMLOA usSkeYuYIcrvM0rM+W8DUa4h8XX3J7AxLAKqEgfXLQerYRPQlni/YBLYDaICERIfVn1lA7FF BPwlZk+azwgxM16i8cY6sHphgSSJe8f7GSHmr2CUONyTBGJzC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VVqUX58UWlOanFhxhNgf6byCwlmpwPTDd5 JfGGxiZmRpZGZsYm5sbGSuK8+iabQoUE0hNLUrNTUwtSi2D6mDg4pRoYDz16xWO5f29qV8Y3 xb4HEx34ZC4WZl2qs9v7WP/cRUv1v7uc2Sc52+2v3M6welfZNNFl8leF9pjpLY7dvDRvX0yi atlKrh+/HUK+pB98W3Wo7qBNd5Zzx+FKocKJjJP3d26oeHHijmxH9ObFh2ftMU5VPTbl55fU D8XPn58J6leMOuq4x4FtsxJLcUaioRZzUXEiAHZXMNb/AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2156 Lines: 63 On 2015년 08월 05일 08:31, Minchan Kim wrote: > Hello, > > On Tue, Aug 04, 2015 at 03:09:37PM -0700, Andrew Morton wrote: >> On Tue, 04 Aug 2015 19:40:08 +0900 Jaewon Kim wrote: >> >>> reclaim_clean_pages_from_list() assumes that shrink_page_list() returns >>> number of pages removed from the candidate list. But shrink_page_list() >>> puts back mlocked pages without passing it to caller and without >>> counting as nr_reclaimed. This incurrs increasing nr_isolated. >>> To fix this, this patch changes shrink_page_list() to pass unevictable >>> pages back to caller. Caller will take care those pages. >>> >>> .. >>> >>> --- a/mm/vmscan.c >>> +++ b/mm/vmscan.c >>> @@ -1157,7 +1157,7 @@ cull_mlocked: >>> if (PageSwapCache(page)) >>> try_to_free_swap(page); >>> unlock_page(page); >>> - putback_lru_page(page); >>> + list_add(&page->lru, &ret_pages); >>> continue; >>> >>> activate_locked: >> >> Is this going to cause a whole bunch of mlocked pages to be migrated >> whereas in current kernels they stay where they are? >> > > It fixes two issues. > > 1. With unevictable page, cma_alloc will be successful. > > Exactly speaking, cma_alloc of current kernel will fail due to unevictable pages. > > 2. fix leaking of NR_ISOLATED counter of vmstat > > With it, too_many_isolated works. Otherwise, it could make hang until > the process get SIGKILL. > > So, I think it's stable material. > > Acked-by: Minchan Kim > > > Hello Traditional shrink_inactive_list will put back the unevictable pages as it does through putback_inactive_pages. However as Minchan Kim said, cma_alloc will be more successful by migrating unevictable pages. In current kernel, I think, cma_alloc is already trying to migrate unevictable pages except clean page cache. This patch will allow clean page cache also to be migrated in cma_alloc. Thank you -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/