Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1266715
| From | Vladimir Davydov <vdavydov@virtuozzo.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 2/6] Revert "gfp: add __GFP_NOACCOUNT" |
| Date | 2015-11-10 19:40 +0100 |
| Message-ID | <qtlZM-d8-45@gated-at.bofh.it> (permalink) |
| References | <qtlZL-d8-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This reverts commit 8f4fc071b1926d0b20336e2b3f8ab85c94c734c5.
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>
Conflicts:
include/linux/memcontrol.h
---
include/linux/gfp.h | 2 --
include/linux/memcontrol.h | 2 --
mm/kmemleak.c | 3 +--
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index f92cbd2f4450..2b917ce34efc 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,7 +30,6 @@ struct vm_area_struct;
#define ___GFP_HARDWALL 0x20000u
#define ___GFP_THISNODE 0x40000u
#define ___GFP_RECLAIMABLE 0x80000u
-#define ___GFP_NOACCOUNT 0x100000u
#define ___GFP_NOTRACK 0x200000u
#define ___GFP_NO_KSWAPD 0x400000u
#define ___GFP_OTHER_NODE 0x800000u
@@ -91,7 +90,6 @@ struct vm_area_struct;
#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
-#define __GFP_NOACCOUNT ((__force gfp_t)___GFP_NOACCOUNT) /* Don't account to kmemcg */
#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
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)
{
if (!memcg_kmem_enabled())
return true;
- if (gfp & __GFP_NOACCOUNT)
- return true;
if (in_interrupt() || (!current->mm) || (current->flags & PF_KTHREAD))
return true;
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 @@
#define BYTES_PER_POINTER sizeof(void *)
/* GFP bitmask for kmemleak internal allocations */
-#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC | \
- __GFP_NOACCOUNT)) | \
+#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \
__GFP_NORETRY | __GFP_NOMEMALLOC | \
__GFP_NOWARN)
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/6] memcg/kmem: switch to white list policy Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
[PATCH v2 5/6] vmalloc: allow to account vmalloc to memcg Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
[PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Tejun Heo <tj@kernel.org> - 2015-11-10 19:40 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 20:00 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Tejun Heo <tj@kernel.org> - 2015-11-11 17:00 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-11 17:10 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Tejun Heo <tj@kernel.org> - 2015-11-11 17:20 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Michal Hocko <mhocko@kernel.org> - 2015-11-12 17:20 +0100
Re: [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-14 12:40 +0100
[PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg" Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
[PATCH v2 3/6] memcg: only account kmem allocations marked as __GFP_ACCOUNT Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
Re: [PATCH v2 3/6] memcg: only account kmem allocations marked as __GFP_ACCOUNT Michal Hocko <mhocko@kernel.org> - 2015-11-12 17:10 +0100
[PATCH v2 2/6] Revert "gfp: add __GFP_NOACCOUNT" Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
[PATCH v2 6/6] Account certain kmem allocations to memcg Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-11-10 19:40 +0100
csiph-web