From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com ([91.189.89.112]:43129 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753034AbbJTVgd (ORCPT ); Tue, 20 Oct 2015 17:36:33 -0400 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Jaewon Kim , Mel Gorman , Andrew Morton , Linus Torvalds , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 62/85] vmscan: fix increasing nr_isolated incurred by putback unevictable pages Date: Tue, 20 Oct 2015 14:35:18 -0700 Message-Id: <1445376941-7046-63-git-send-email-kamal@canonical.com> In-Reply-To: <1445376941-7046-1-git-send-email-kamal@canonical.com> References: <1445376941-7046-1-git-send-email-kamal@canonical.com> Sender: stable-owner@vger.kernel.org List-ID: 3.13.11-ckt28 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Jaewon Kim commit c54839a722a02818677bcabe57e957f0ce4f841d upstream. 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 increases nr_isolated. To fix this, this patch changes shrink_page_list() to pass unevictable pages back to caller. Caller will take care those pages. Minchan said: 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. Signed-off-by: Jaewon Kim Acked-by: Minchan Kim Cc: Mel Gorman Acked-by: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Kamal Mostafa --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index e45f42b..2d18258 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1068,7 +1068,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: -- 1.9.1