From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, alex.shi@linux.alibaba.com,
bhe@redhat.com, chris@chrisdown.name, guro@fb.com,
hannes@cmpxchg.org, hughd@google.com, linux-mm@kvack.org,
lstoakes@gmail.com, mhocko@suse.com, mm-commits@vger.kernel.org,
sh_def@163.com, shakeelb@google.com,
torvalds@linux-foundation.org, vbabka@suse.cz
Subject: [patch 03/10] mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
Date: Tue, 12 Jan 2021 15:49:11 -0800 [thread overview]
Message-ID: <20210112234911.PDWRysjU0%akpm@linux-foundation.org> (raw)
In-Reply-To: <20210112154839.abeb6e57de79480059fd9b0e@linux-foundation.org>
From: Hugh Dickins <hughd@google.com>
Subject: mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
Boot a CONFIG_MEMCG=y kernel with "cgroup_disabled=memory" and you are met
by a series of warnings from the VM_WARN_ON_ONCE_PAGE(!memcg, page)
recently added to the inline mem_cgroup_page_lruvec().
An earlier attempt to place that warning, in mem_cgroup_lruvec(), had been
careful to do so after weeding out the mem_cgroup_disabled() case; but was
itself invalid because of the mem_cgroup_lruvec(NULL, pgdat) in
clear_pgdat_congested() and age_active_anon().
Warning in mem_cgroup_page_lruvec() was once useful in detecting a KSM
charge bug, so may be worth keeping: but skip if mem_cgroup_disabled().
Link: https://lkml.kernel.org/r/alpine.LSU.2.11.2101032056260.1093@eggly.anvils
Fixes: 9a1ac2288cf1 ("mm/memcontrol:rewrite mem_cgroup_page_lruvec()")
Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Alex Shi <alex.shi@linux.alibaba.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: Chris Down <chris@chrisdown.name>
Reviewed-by: Baoquan He <bhe@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hui Su <sh_def@163.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/memcontrol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/memcontrol.h~mm-memcontrol-fix-warning-in-mem_cgroup_page_lruvec
+++ a/include/linux/memcontrol.h
@@ -665,7 +665,7 @@ static inline struct lruvec *mem_cgroup_
{
struct mem_cgroup *memcg = page_memcg(page);
- VM_WARN_ON_ONCE_PAGE(!memcg, page);
+ VM_WARN_ON_ONCE_PAGE(!memcg && !mem_cgroup_disabled(), page);
return mem_cgroup_lruvec(memcg, pgdat);
}
_
next prev parent reply other threads:[~2021-01-12 23:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 23:48 incoming Andrew Morton
2021-01-12 23:49 ` [patch 01/10] mm, slub: consider rest of partial list if acquire_slab() fails Andrew Morton
2021-01-12 23:49 ` [patch 02/10] mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint Andrew Morton
2021-01-12 23:49 ` Andrew Morton [this message]
2021-01-12 23:49 ` [patch 04/10] arm/kasan: fix the array size of kasan_early_shadow_pte[] Andrew Morton
2021-01-12 23:49 ` [patch 05/10] mm/vmalloc.c: fix potential memory leak Andrew Morton
2021-01-12 23:49 ` [patch 06/10] mm: migrate: initialize err in do_migrate_pages Andrew Morton
2021-01-12 23:49 ` [patch 07/10] mm/hugetlb: fix potential missing huge page size info Andrew Morton
2021-01-12 23:49 ` [patch 08/10] MAINTAINERS: add Vlastimil as slab allocators maintainer Andrew Morton
2021-01-12 23:49 ` [patch 09/10] mm,hwpoison: fix printing of page flags Andrew Morton
2021-01-12 23:49 ` [patch 10/10] mm/process_vm_access.c: include compat.h Andrew Morton
2021-01-15 23:32 ` incoming Linus Torvalds
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=20210112234911.PDWRysjU0%akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=bhe@redhat.com \
--cc=chris@chrisdown.name \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@suse.com \
--cc=mm-commits@vger.kernel.org \
--cc=sh_def@163.com \
--cc=shakeelb@google.com \
--cc=torvalds@linux-foundation.org \
--cc=vbabka@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).