lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 20 Oct 2014 20:59:44 +0200
From:	Michal Hocko <>
To:	Johannes Weiner <>
Cc:	Andrew Morton <>,
	Vladimir Davydov <>,,,
Subject: Re: [patch] mm: memcontrol: micro-optimize

On Mon 20-10-14 11:17:39, Johannes Weiner wrote:
> Do not look up the page_cgroup when the memory controller is
> runtime-disabled, but do assert that the locking protocol is followed
> under DEBUG_VM regardless.  Also remove the unused flags variable.
> Signed-off-by: Johannes Weiner <>

Acked-by: Michal Hocko <>

mem_cgroup_split_huge_fixup is following the same pattern and might be
folded into this one. I can send a separate patch if you prefer, though.
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3a203c7ec6c7..544e32292c7f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3167,7 +3167,7 @@ static inline void memcg_unregister_all_caches(struct mem_cgroup *memcg)
 void mem_cgroup_split_huge_fixup(struct page *head)
-	struct page_cgroup *head_pc = lookup_page_cgroup(head);
+	struct page_cgroup *head_pc;
 	struct page_cgroup *pc;
 	struct mem_cgroup *memcg;
 	int i;
@@ -3175,6 +3175,8 @@ void mem_cgroup_split_huge_fixup(struct page *head)
 	if (mem_cgroup_disabled())
+	head_pc = lookup_page_cgroup(head);
 	memcg = head_pc->mem_cgroup;
 	for (i = 1; i < HPAGE_PMD_NR; i++) {
 		pc = head_pc + i;
Michal Hocko
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists