From: Lorenzo Stoakes <lstoakes@gmail.com>
To: syzbot <syzbot+ce635500093181f39c1c@syzkaller.appspotmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>,
Linux-Next Mailing List <linux-next@vger.kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
Alex Shi <alex.shi@linux.alibaba.com>, Hui Su <sh_def@163.com>
Subject: Re: linux-next boot error: WARNING in prepare_kswapd_sleep
Date: Tue, 24 Nov 2020 17:59:52 +0000 [thread overview]
Message-ID: <CAA5enKZ=6=AoknavW4RJ+T+aiPBFSf8uEjJ+ODcc+nMTD2k5kQ@mail.gmail.com> (raw)
In-Reply-To: <00000000000054aea005b4d59e71@google.com>
On Tue, 24 Nov 2020 at 07:54, syzbot
<syzbot+ce635500093181f39c1c@syzkaller.appspotmail.com> wrote:
> syzbot found the following issue on:
>
> HEAD commit: d9137320 Add linux-next specific files for 20201124
This appears to be a product of 4b2904f3 ("mm/memcg: add missed
warning in mem_cgroup_lruvec") adding a VM_WARN_ON_ONCE() to
mem_cgroup_lruvec, which when invoked from a function other than
mem_cgroup_page_lruvec() can in fact be called with the condition
false.
If we move the check back into mem_cgroup_page_lruvec() it resolves
the issue. I enclose a simple version of this below, happy to submit
as a proper patch if this is the right approach:
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 87ed56dc75f9..27cc40a490b2 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -618,7 +618,6 @@ static inline struct lruvec
*mem_cgroup_lruvec(struct mem_cgroup *memcg,
goto out;
}
- VM_WARN_ON_ONCE(!memcg);
if (!memcg)
memcg = root_mem_cgroup;
@@ -645,6 +644,7 @@ static inline struct lruvec
*mem_cgroup_lruvec(struct mem_cgroup *memcg,
static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
struct pglist_data *pgdat)
{
+ VM_WARN_ON_ONCE_PAGE(!page_memcg(page), page);
return mem_cgroup_lruvec(page_memcg(page), pgdat);
}
next prev parent reply other threads:[~2020-11-24 18:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-24 7:54 linux-next boot error: WARNING in prepare_kswapd_sleep syzbot
2020-11-24 17:59 ` Lorenzo Stoakes [this message]
2020-11-25 6:24 ` Alex Shi
2020-11-25 11:25 ` Lorenzo Stoakes
2020-11-25 11:22 ` [PATCH] mm/memcg: warn on missing memcg on mem_cgroup_page_lruvec() Lorenzo Stoakes
2020-11-25 12:15 ` Alex Shi
2020-11-25 22:27 ` Stephen Rothwell
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='CAA5enKZ=6=AoknavW4RJ+T+aiPBFSf8uEjJ+ODcc+nMTD2k5kQ@mail.gmail.com' \
--to=lstoakes@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alex.shi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=sh_def@163.com \
--cc=syzbot+ce635500093181f39c1c@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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;
as well as URLs for NNTP newsgroup(s).