From: Shakeel Butt <shakeel.butt@linux.dev>
To: Farhad Alemi <farhad.alemi@berkeley.edu>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
falemi@asu.edu, cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] refill_stock -- VM_WARN_ON_ONCE(mem_cgroup_is_root()) from a write to the cgroup-v2 root's memory.reclaim
Date: Fri, 28 Aug 2026 09:53:50 -0700 [thread overview]
Message-ID: <apG8lKU0xDitsvV7@linux.dev> (raw)
In-Reply-To: <CA+0ovCgWzUMK+nNbbtH7eV65Ca=fDN4Ozu7iASgryjvv8Tk8zQ@mail.gmail.com>
On Thu, Aug 27, 2026 at 10:28:57PM -0700, Farhad Alemi wrote:
> Hello,
>
> As part of the kernel research at ASU's SEFCOM
> lab, we hit the crash below. Crash reports can be found here:
>
> https://github.com/farhad-alemi/public_bug_reports/tree/main/145-memcg-vm_warn-refill_stock-root-cgroup/
>
> mem_cgroup_is_root(memcg)
> WARNING: mm/memcontrol.c:2198 at refill_stock+0x644/0x940, CPU#1: repro/9490
> Call Trace:
> refill_stock+0x644/0x940
> try_charge_memcg+0x12d6/0x1570
> __obj_cgroup_charge+0x35/0xf0
> obj_cgroup_charge+0x1de/0x210
> obj_cgroup_charge_zswap+0x83/0x270
> zswap_store+0x1620/0x2000
> swap_writeout+0x94c/0x14c0
> shrink_folio_list+0x3388/0x52b0
> evict_folios+0x374d/0x48c0
> try_to_shrink_lruvec+0xe72/0x1350
> shrink_node+0x3320/0x3b90
> do_try_to_free_pages+0x6a2/0x1990
> try_to_free_mem_cgroup_pages+0x30d/0x830
> user_proactive_reclaim+0x504/0x840
> memory_reclaim+0x1f/0x30
> cgroup_file_write+0x331/0x8f0
> kernfs_fop_write_iter+0x3af/0x540
>
> Our reproducer.c is available upon request.
>
> Happy to test a patch if that would help.
Thanks for the report. Please test the following patch. I will send formal patch
after your testing.
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4a18ee4509ab..1709ac96bbde 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3157,7 +3157,7 @@ static int obj_cgroup_charge_pages(struct obj_cgroup *objcg, gfp_t gfp,
memcg = get_mem_cgroup_from_objcg(objcg);
- ret = try_charge_memcg(memcg, gfp, nr_pages);
+ ret = try_charge(memcg, gfp, nr_pages);
if (ret)
goto out;
prev parent reply other threads:[~2026-08-28 16:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 5:28 [BUG] refill_stock -- VM_WARN_ON_ONCE(mem_cgroup_is_root()) from a write to the cgroup-v2 root's memory.reclaim Farhad Alemi
2026-08-28 16:53 ` Shakeel Butt [this message]
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=apG8lKU0xDitsvV7@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=falemi@asu.edu \
--cc=farhad.alemi@berkeley.edu \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=roman.gushchin@linux.dev \
/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.