Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1266709

[PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg"

From Vladimir Davydov <vdavydov@virtuozzo.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg"
Date 2015-11-10 19:40 +0100
Message-ID <qtlZM-d8-21@gated-at.bofh.it> (permalink)
References <qtlZL-d8-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This reverts commit 499611ed451508a42d1d7d1faff10177827755d5.

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>
---
 fs/kernfs/dir.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 91e004518237..0239a0a76ed5 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -541,14 +541,7 @@ static struct kernfs_node *__kernfs_new_node(struct kernfs_root *root,
 	if (!kn)
 		goto err_out1;
 
-	/*
-	 * If the ino of the sysfs entry created for a kmem cache gets
-	 * allocated from an ida layer, which is accounted to the memcg that
-	 * owns the cache, the memcg will get pinned forever. So do not account
-	 * ino ida allocations.
-	 */
-	ret = ida_simple_get(&root->ino_ida, 1, 0,
-			     GFP_KERNEL | __GFP_NOACCOUNT);
+	ret = ida_simple_get(&root->ino_ida, 1, 0, GFP_KERNEL);
 	if (ret < 0)
 		goto err_out2;
 	kn->ino = ret;
-- 
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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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