From: akpm@linux-foundation.org Subject: [merged] mm-swapc-clear-pageactive-before-adding-pages-onto-unevictable-list.patch removed from -mm tree Date: Mon, 05 Aug 2013 12:05:51 -0700 Message-ID: <51fff78f.I1foPS4KZzFYLcwN%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42000 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754198Ab3HETF5 (ORCPT ); Mon, 5 Aug 2013 15:05:57 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: mm-commits@vger.kernel.org, mgorman@suse.de, kosaki.motohiro@jp.fujitsu.com, kirill.shutemov@linux.intel.com, n-horiguchi@ah.jp.nec.com Subject: [merged] mm-swapc-clear-pageactive-before-adding-pages-onto-unevictable-list.patch removed from -mm tree To: n-horiguchi@ah.jp.nec.com,kirill.shutemov@linux.intel.com,kosaki.motohiro@jp.fujitsu.com,mgorman@suse.de,mm-commits@vger.kernel.org From: akpm@linux-foundation.org Date: Mon, 05 Aug 2013 12:05:51 -0700 The patch titled Subject: mm/swap.c: clear PageActive before adding pages onto unevictable list has been removed from the -mm tree. Its filename was mm-swapc-clear-pageactive-before-adding-pages-onto-unevictable-list.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Naoya Horiguchi Subject: mm/swap.c: clear PageActive before adding pages onto unevictable list As a result of v3.10-3600-g13f7f78 ("mm: pagevec: defer deciding which LRU to add a page to until pagevec drain time"), pages on unevictable lists can have both of PageActive and PageUnevictable set. This is not only confusing, but also corrupts page migration and shrink_[in]active_list. This patch fixes the problem by adding ClearPageActive before adding pages into unevictable list. It also cleans up VM_BUG_ONs. Signed-off-by: Naoya Horiguchi Cc: Mel Gorman Cc: KOSAKI Motohiro Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton --- mm/swap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff -puN mm/swap.c~mm-swapc-clear-pageactive-before-adding-pages-onto-unevictable-list mm/swap.c --- a/mm/swap.c~mm-swapc-clear-pageactive-before-adding-pages-onto-unevictable-list +++ a/mm/swap.c @@ -512,12 +512,7 @@ EXPORT_SYMBOL(__lru_cache_add); */ void lru_cache_add(struct page *page) { - if (PageActive(page)) { - VM_BUG_ON(PageUnevictable(page)); - } else if (PageUnevictable(page)) { - VM_BUG_ON(PageActive(page)); - } - + VM_BUG_ON(PageActive(page) && PageUnevictable(page)); VM_BUG_ON(PageLRU(page)); __lru_cache_add(page); } @@ -539,6 +534,7 @@ void add_page_to_unevictable_list(struct spin_lock_irq(&zone->lru_lock); lruvec = mem_cgroup_page_lruvec(page, zone); + ClearPageActive(page); SetPageUnevictable(page); SetPageLRU(page); add_page_to_lru_list(page, lruvec, LRU_UNEVICTABLE); @@ -833,7 +829,6 @@ static void __pagevec_lru_add_fn(struct int active = PageActive(page); enum lru_list lru = page_lru(page); - VM_BUG_ON(PageUnevictable(page)); VM_BUG_ON(PageLRU(page)); SetPageLRU(page); _ Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are mm-hugetlb-move-up-the-code-which-check-availability-of-free-huge-page.patch mm-hugetlb-trivial-commenting-fix.patch mm-hugetlb-clean-up-alloc_huge_page.patch mm-hugetlb-fix-and-clean-up-node-iteration-code-to-alloc-or-free.patch mm-hugetlb-remove-redundant-list_empty-check-in-gather_surplus_pages.patch mm-hugetlb-do-not-use-a-page-in-page-cache-for-cow-optimization.patch mm-hugetlb-add-vm_noreserve-check-in-vma_has_reserves.patch mm-hugetlb-remove-decrement_hugepage_resv_vma.patch mm-hugetlb-decrement-reserve-count-if-vm_noreserve-alloc-page-cache.patch