From: Vladimir Davydov <vdavydov@virtuozzo.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Tejun Heo <tj@kernel.org>, Greg Thelen <gthelen@google.com>, Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, <linux-mm@kvack.org>, <cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg" Date: Tue, 10 Nov 2015 21:34:02 +0300 [thread overview] Message-ID: <c468a2d2b39d755de2383c6ae49be6a53360a22b.1447172835.git.vdavydov@virtuozzo.com> (raw) In-Reply-To: <cover.1447172835.git.vdavydov@virtuozzo.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@virtuozzo.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@kernel.org>, Tejun Heo <tj@kernel.org>, Greg Thelen <gthelen@google.com>, Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg" Date: Tue, 10 Nov 2015 21:34:02 +0300 [thread overview] Message-ID: <c468a2d2b39d755de2383c6ae49be6a53360a22b.1447172835.git.vdavydov@virtuozzo.com> (raw) In-Reply-To: <cover.1447172835.git.vdavydov@virtuozzo.com> 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-11-10 18:34 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-11-10 18:34 [PATCH v2 0/6] memcg/kmem: switch to white list policy Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov [this message] 2015-11-10 18:34 ` [PATCH v2 1/6] Revert "kernfs: do not account ino_ida allocations to memcg" Vladimir Davydov 2015-11-19 18:56 ` Johannes Weiner 2015-11-19 18:56 ` Johannes Weiner 2015-11-10 18:34 ` [PATCH v2 2/6] Revert "gfp: add __GFP_NOACCOUNT" Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-19 18:59 ` Johannes Weiner 2015-11-19 18:59 ` Johannes Weiner 2015-11-10 18:34 ` [PATCH v2 3/6] memcg: only account kmem allocations marked as __GFP_ACCOUNT Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-12 16:04 ` Michal Hocko 2015-11-12 16:04 ` Michal Hocko 2015-11-12 16:04 ` Michal Hocko 2015-11-19 19:00 ` Johannes Weiner 2015-11-19 19:00 ` Johannes Weiner 2015-11-19 19:00 ` Johannes Weiner 2015-11-10 18:34 ` [PATCH v2 4/6] slab: add SLAB_ACCOUNT flag Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-10 18:38 ` Tejun Heo 2015-11-10 18:38 ` Tejun Heo 2015-11-10 18:38 ` Tejun Heo 2015-11-10 18:54 ` Vladimir Davydov 2015-11-10 18:54 ` Vladimir Davydov 2015-11-11 15:54 ` Tejun Heo 2015-11-11 15:54 ` Tejun Heo 2015-11-11 15:54 ` Tejun Heo 2015-11-11 16:07 ` Vladimir Davydov 2015-11-11 16:07 ` Vladimir Davydov 2015-11-11 16:07 ` Vladimir Davydov 2015-11-11 16:19 ` Tejun Heo 2015-11-11 16:19 ` Tejun Heo 2015-11-12 16:17 ` Michal Hocko 2015-11-12 16:17 ` Michal Hocko 2015-11-12 16:17 ` Michal Hocko 2015-11-14 11:29 ` Vladimir Davydov 2015-11-14 11:29 ` Vladimir Davydov 2015-11-19 19:01 ` Johannes Weiner 2015-11-19 19:01 ` Johannes Weiner 2015-11-19 19:01 ` Johannes Weiner 2015-11-10 18:34 ` [PATCH v2 5/6] vmalloc: allow to account vmalloc to memcg Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-19 19:04 ` Johannes Weiner 2015-11-19 19:04 ` Johannes Weiner 2015-11-19 19:04 ` Johannes Weiner 2015-11-10 18:34 ` [PATCH v2 6/6] Account certain kmem allocations " Vladimir Davydov 2015-11-10 18:34 ` Vladimir Davydov 2015-11-12 16:50 ` Michal Hocko 2015-11-12 16:50 ` Michal Hocko 2015-11-12 16:50 ` Michal Hocko 2015-11-19 19:12 ` Johannes Weiner 2015-11-19 19:12 ` Johannes Weiner 2015-11-19 19:12 ` Johannes Weiner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=c468a2d2b39d755de2383c6ae49be6a53360a22b.1447172835.git.vdavydov@virtuozzo.com \ --to=vdavydov@virtuozzo.com \ --cc=akpm@linux-foundation.org \ --cc=cgroups@vger.kernel.org \ --cc=cl@linux.com \ --cc=gthelen@google.com \ --cc=hannes@cmpxchg.org \ --cc=iamjoonsoo.kim@lge.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mhocko@kernel.org \ --cc=penberg@kernel.org \ --cc=rientjes@google.com \ --cc=tj@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.