aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@virtuozzo.com>2016-01-14 18:18:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:00:49 -0500
commit20b5c30398639b458371c228abfda829854b61c5 (patch)
tree366edd361af32ead1f7be2de21e3da5c435d8636
parentb2a209ffa605994cbe3c259c8584ba1576d3310c (diff)
Revert "gfp: add __GFP_NOACCOUNT"
This reverts commit 8f4fc071b192 ("gfp: add __GFP_NOACCOUNT"). Black-list kmem accounting policy (aka __GFP_NOACCOUNT) turned out to be fragile and difficult to maintain, because there seem to be many more allocations that should not be accounted than those that should be. Besides, false accounting an allocation might result in much worse consequences than not accounting at all, namely increased memory consumption due to pinned dead kmem caches. So it was decided to switch to the white-list policy. This patch reverts bits introducing the black-list policy. The white-list policy will be introduced later in the series. Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: Greg Thelen <gthelen@google.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/memcontrol.h2
-rw-r--r--mm/kmemleak.c3
3 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 8942af0813e3..075b014448f5 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,7 +30,6 @@ struct vm_area_struct;
30#define ___GFP_HARDWALL 0x20000u 30#define ___GFP_HARDWALL 0x20000u
31#define ___GFP_THISNODE 0x40000u 31#define ___GFP_THISNODE 0x40000u
32#define ___GFP_ATOMIC 0x80000u 32#define ___GFP_ATOMIC 0x80000u
33#define ___GFP_NOACCOUNT 0x100000u
34#define ___GFP_NOTRACK 0x200000u 33#define ___GFP_NOTRACK 0x200000u
35#define ___GFP_DIRECT_RECLAIM 0x400000u 34#define ___GFP_DIRECT_RECLAIM 0x400000u
36#define ___GFP_OTHER_NODE 0x800000u 35#define ___GFP_OTHER_NODE 0x800000u
@@ -104,7 +103,6 @@ struct vm_area_struct;
104#define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) 103#define __GFP_HIGH ((__force gfp_t)___GFP_HIGH)
105#define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC) 104#define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC)
106#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) 105#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC)
107#define __GFP_NOACCOUNT ((__force gfp_t)___GFP_NOACCOUNT)
108 106
109/* 107/*
110 * Reclaim modifiers 108 * Reclaim modifiers
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index cd0e2413c358..2103f36b3bd3 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -773,8 +773,6 @@ static inline bool __memcg_kmem_bypass(gfp_t gfp)
773{ 773{
774 if (!memcg_kmem_enabled()) 774 if (!memcg_kmem_enabled())
775 return true; 775 return true;
776 if (gfp & __GFP_NOACCOUNT)
777 return true;
778 if (in_interrupt() || (!current->mm) || (current->flags & PF_KTHREAD)) 776 if (in_interrupt() || (!current->mm) || (current->flags & PF_KTHREAD))
779 return true; 777 return true;
780 return false; 778 return false;
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 19423a45d7d7..25c0ad36fe38 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -122,8 +122,7 @@
122#define BYTES_PER_POINTER sizeof(void *) 122#define BYTES_PER_POINTER sizeof(void *)
123 123
124/* GFP bitmask for kmemleak internal allocations */ 124/* GFP bitmask for kmemleak internal allocations */
125#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC | \ 125#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \
126 __GFP_NOACCOUNT)) | \
127 __GFP_NORETRY | __GFP_NOMEMALLOC | \ 126 __GFP_NORETRY | __GFP_NOMEMALLOC | \
128 __GFP_NOWARN) 127 __GFP_NOWARN)
129 128