From: Shakeel Butt <shakeel.butt@linux.dev>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: syzbot <syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com>,
akpm@linux-foundation.org, cgroups@vger.kernel.org,
hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, mhocko@kernel.org, muchun.song@linux.dev,
roman.gushchin@linux.dev, syzkaller-bugs@googlegroups.com,
yuzhao@google.com
Subject: Re: [syzbot] [mm?] [cgroups?] WARNING in __mod_memcg_lruvec_state
Date: Mon, 6 May 2024 08:59:26 -0700 [thread overview]
Message-ID: <gbsy4rpt3fbcspuepstk6tzzwd3mrosuba7ufm7phopwor4pyb@ucxrvdw6nly3> (raw)
In-Reply-To: <ZjjlLcjHuQoV-7gh@google.com>
On Mon, May 06, 2024 at 02:11:57PM +0000, Yosry Ahmed wrote:
> On Mon, May 06, 2024 at 06:03:29AM -0700, syzbot wrote:
> > syzbot has found a reproducer for the following issue on:
> >
> > HEAD commit: 2b84edefcad1 Add linux-next specific files for 20240506
> > git tree: linux-next
> > console+strace: https://syzkaller.appspot.com/x/log.txt?x=1164931f180000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=b499929e4aaba1af
> > dashboard link: https://syzkaller.appspot.com/bug?extid=9319a4268a640e26b72b
> > compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=123d5d1f180000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16527450980000
> >
> > Downloadable assets:
> > disk image: https://storage.googleapis.com/syzbot-assets/6a22cf95ee14/disk-2b84edef.raw.xz
> > vmlinux: https://storage.googleapis.com/syzbot-assets/f5c45b515282/vmlinux-2b84edef.xz
> > kernel image: https://storage.googleapis.com/syzbot-assets/9bf98258a662/bzImage-2b84edef.xz
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com
> >
> > ------------[ cut here ]------------
> > __mod_memcg_lruvec_state: missing stat item 25
> > WARNING: CPU: 0 PID: 5091 at mm/memcontrol.c:999 __mod_memcg_lruvec_state+0x18c/0x430 mm/memcontrol.c:999
>
> This doesn't seem to be the same issue as the original one syzbot
> reported. It's the same function but a different warning. I am not sure
> how to tell syzbot that.
>
> Anyway, this warning is the one newly introduced by Shakeel. It is
> firing because NR_SHMEM_PMDMAPPED and/or NR_FILE_PMDMAPPED are being
> updated using __lruvec_stat_mod_folio(), which also updates the memcg
> stats. However, these stats are not exported per-memcg.
>
> I think the following should fix it.
>
Hey Yosry, can you please post your patch with the signoff? The patch
looks good and you can put my ack on it.
> #syz test
>
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 12be4241474ab..d3a26ea4dbae2 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1441,7 +1441,7 @@ static __always_inline void __folio_add_file_rmap(struct folio *folio,
>
> nr = __folio_add_rmap(folio, page, nr_pages, level, &nr_pmdmapped);
> if (nr_pmdmapped)
> - __lruvec_stat_mod_folio(folio, folio_test_swapbacked(folio) ?
> + __mod_node_page_state(folio, folio_test_swapbacked(folio) ?
> NR_SHMEM_PMDMAPPED : NR_FILE_PMDMAPPED, nr_pmdmapped);
> if (nr)
> __lruvec_stat_mod_folio(folio, NR_FILE_MAPPED, nr);
>
next prev parent reply other threads:[~2024-05-06 15:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 8:03 [syzbot] [cgroups?] [mm?] " syzbot
2024-04-04 1:07 ` Andrew Morton
2024-04-04 23:36 ` Yosry Ahmed
2024-04-05 1:44 ` Yu Zhao
2024-04-05 4:47 ` Yosry Ahmed
2024-04-14 4:43 ` Shakeel Butt
2024-05-06 13:03 ` [syzbot] [mm?] [cgroups?] " syzbot
2024-05-06 14:11 ` Yosry Ahmed
2024-05-06 15:59 ` Shakeel Butt [this message]
2024-05-06 16:12 ` Yosry Ahmed
2024-05-06 16:13 ` syzbot
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=gbsy4rpt3fbcspuepstk6tzzwd3mrosuba7ufm7phopwor4pyb@ucxrvdw6nly3 \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=syzbot+9319a4268a640e26b72b@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=yosryahmed@google.com \
--cc=yuzhao@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox