From: akpm@linux-foundation.org
To: borntraeger@de.ibm.com, duanxiongchun@bytedance.com, guro@fb.com,
hannes@cmpxchg.org, linmiaohe@huawei.com, mhocko@kernel.org,
mm-commits@vger.kernel.org, shakeelb@google.com,
songmuchun@bytedance.com, vdavydov.dev@gmail.com
Subject: [folded-merged] mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages-fix.patch removed from -mm tree
Date: Thu, 29 Apr 2021 22:24:41 -0700 [thread overview]
Message-ID: <20210430052441.UL3Tbb8-F%akpm@linux-foundation.org> (raw)
The patch titled
Subject: mm: memcontrol: fix forget to obtain the ref to objcg in split_page_memcg
has been removed from the -mm tree. Its filename was
mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages-fix.patch
This patch was dropped because it was folded into mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages.patch
------------------------------------------------------
From: Muchun Song <songmuchun@bytedance.com>
Subject: mm: memcontrol: fix forget to obtain the ref to objcg in split_page_memcg
Christian Borntraeger reported a warning about "percpu ref
(obj_cgroup_release) <= 0 (-1) after switching to atomic". Because we
forgot to obtain the reference to the objcg and wrongly obtain the
reference of memcg.
Link: https://lkml.kernel.org/r/20210401030141.37061-1-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Roman Gushchin <guro@fb.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/memcontrol.h | 6 ++++++
mm/memcontrol.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
--- a/include/linux/memcontrol.h~mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages-fix
+++ a/include/linux/memcontrol.h
@@ -798,6 +798,12 @@ static inline void obj_cgroup_get(struct
percpu_ref_get(&objcg->refcnt);
}
+static inline void obj_cgroup_get_many(struct obj_cgroup *objcg,
+ unsigned long nr)
+{
+ percpu_ref_get_many(&objcg->refcnt, nr);
+}
+
static inline void obj_cgroup_put(struct obj_cgroup *objcg)
{
percpu_ref_put(&objcg->refcnt);
--- a/mm/memcontrol.c~mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages-fix
+++ a/mm/memcontrol.c
@@ -3270,7 +3270,11 @@ void split_page_memcg(struct page *head,
for (i = 1; i < nr; i++)
head[i].memcg_data = head->memcg_data;
- css_get_many(&memcg->css, nr - 1);
+
+ if (PageMemcgKmem(head))
+ obj_cgroup_get_many(__page_objcg(head), nr - 1);
+ else
+ css_get_many(&memcg->css, nr - 1);
}
#ifdef CONFIG_MEMCG_SWAP
_
Patches currently in -mm which might be from songmuchun@bytedance.com are
mm-memcontrol-fix-kernel-stack-account.patch
mm-memcontrol-slab-fix-obtain-a-reference-to-a-freeing-memcg.patch
mm-memcontrol-introduce-obj_cgroup_uncharge_pages.patch
mm-memcontrol-directly-access-page-memcg_data-in-mm-page_allocc.patch
mm-memcontrol-change-ug-dummy_page-only-if-memcg-changed.patch
mm-memcontrol-use-obj_cgroup-apis-to-charge-kmem-pages.patch
mm-memcontrol-inline-__memcg_kmem_uncharge-into-obj_cgroup_uncharge_pages.patch
mm-memcontrol-move-pagememcgkmem-to-the-scope-of-config_memcg_kmem.patch
reply other threads:[~2021-04-30 5:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210430052441.UL3Tbb8-F%akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=borntraeger@de.ibm.com \
--cc=duanxiongchun@bytedance.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=shakeelb@google.com \
--cc=songmuchun@bytedance.com \
--cc=vdavydov.dev@gmail.com \
/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: link
Be 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.