[RHEL7,COMMIT] Revert "mm/page_alloc.c: check if page cgroup still in use during alloc/free."

Submitted by Konstantin Khorenko on Oct. 22, 2019, 10:36 a.m.

Details

Message ID 201910221036.x9MAajg0011171@finist-ce7.sw.ru
State New
Series "mm/page_alloc.c: check if page cgroup still in use during alloc/free."
Headers show

Commit Message

Konstantin Khorenko Oct. 22, 2019, 10:36 a.m.
The commit is pushed to "branch-rh7-3.10.0-1062.1.2.vz7.114.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.1.2.vz7.114.8
------>
commit 6407127a944f1b8e2969b82643ceba99e04c588d
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Tue Oct 22 13:33:55 2019 +0300

    Revert "mm/page_alloc.c: check if page cgroup still in use during alloc/free."
    
    This reverts commit cf8aaacbc2c2b191b39ef9f677dbd5cbba3729a1.
    
    Reverting the debug patch: it did not provide us any single case,
    at the same time issues are not reported anymore, probably
    it was fixed as a side effect.
    
    Anyway, we don't need a debug BUG_ON() in the release code.
    
    https://jira.sw.ru/browse/PSBM-96036
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 mm/page_alloc.c  | 22 ----------------------
 mm/page_cgroup.c |  3 +--
 2 files changed, 1 insertion(+), 24 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6094599b86b3..c9032ab1dc09 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -976,25 +976,6 @@  void __meminit reserve_bootmem_region(unsigned long start, unsigned long end)
 	}
 }
 
-static void check_memcg(struct page *page)
-{
-	struct page_cgroup *pc;
-	extern int page_cgroup_inited;
-
-	if (!page_cgroup_inited)
-		return;
-
-	pc = lookup_page_cgroup(page);
-	/*
-	 * Fast unlocked return. Theoretically might have changed, have to
-	 * check again after locking.
-	 */
-	if (!pc || !PageCgroupUsed(pc))
-		return;
-
-	BUG_ON(1);
-}
-
 static bool free_pages_prepare(struct page *page, unsigned int order)
 {
 	int i;
@@ -1007,8 +988,6 @@  static bool free_pages_prepare(struct page *page, unsigned int order)
 	if (PageAnon(page))
 		page->mapping = NULL;
 	memcg_kmem_uncharge_pages(page, order);
-	check_memcg(page);
-
 	for (i = 0; i < (1 << order); i++) {
 		bad += free_pages_check(page + i);
 		if (static_key_false(&zero_free_pages))
@@ -1602,7 +1581,6 @@  static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
 	arch_alloc_page(page, order);
 	kernel_map_pages(page, 1 << order, 1);
 	kasan_alloc_pages(page, order);
-	check_memcg(page);
 
 	if (gfp_flags & __GFP_ZERO)
 		prep_zero_page(page, order, gfp_flags);
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index a856d993f274..452f59a4fe90 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -266,7 +266,7 @@  static int __meminit page_cgroup_callback(struct notifier_block *self,
 }
 
 #endif
-int page_cgroup_inited;
+
 void __init page_cgroup_init(void)
 {
 	unsigned long pfn;
@@ -309,7 +309,6 @@  void __init page_cgroup_init(void)
 	printk(KERN_INFO "please try 'cgroup_disable=memory' option if you "
 			 "don't want memory cgroups\n");
 	invoke_page_ext_init_callbacks();
-	page_cgroup_inited = true;
 	return;
 oom:
 	printk(KERN_CRIT "try 'cgroup_disable=memory' boot option\n");