From: Vladimir Davydov Date: Sat, 13 Dec 2014 00:55:13 +0000 (-0800) Subject: memcg: only check memcg_kmem_skip_account in __memcg_kmem_get_cache X-Git-Tag: omap-for-v3.20/drop-legacy-3517~97^2~77 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e701d7b37789d1aeb0015210b373912e5d30733;p=pandora-kernel.git memcg: only check memcg_kmem_skip_account in __memcg_kmem_get_cache __memcg_kmem_get_cache can recurse if it calls kmalloc (which it does if the cgroup's kmem cache doesn't exist), because kmalloc may call __memcg_kmem_get_cache internally again. To avoid the recursion, we use the task_struct->memcg_kmem_skip_account flag. However, there's no need checking the flag in memcg_kmem_newpage_charge, because there's no way how this function could result in recursion, if called from memcg_kmem_get_cache. So let's remove the redundant code. Signed-off-by: Vladimir Davydov Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed