All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Yang Shi <shy828301@gmail.com>
Cc: syzbot <syzbot+1f52b3a18d5633fa7f82@syzkaller.appspotmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alistair Popple <apopple@nvidia.com>,
	chinwen.chang@mediatek.com, fgheet255t@gmail.com,
	Jann Horn <jannh@google.com>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>, Peter Xu <peterx@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	syzkaller-bugs@googlegroups.com, tonymarislogistics@yandex.com,
	Vlastimil Babka <vbabka@suse.cz>,
	walken@google.com, Zi Yan <ziy@nvidia.com>
Subject: Re: [syzbot] kernel BUG in __page_mapcount
Date: Tue, 21 Dec 2021 18:40:15 +0000	[thread overview]
Message-ID: <YcIfj3nfuL0kzkFO@casper.infradead.org> (raw)
In-Reply-To: <CAHbLzkoU_giAFiOyhHZvxLT9Vie2-8TmQv_XLDpRxbec5r5weg@mail.gmail.com>

On Tue, Dec 21, 2021 at 10:24:27AM -0800, Yang Shi wrote:
> It seems the THP is split during smaps walk. The reproducer does call
> MADV_FREE on partial THP which may split the huge page.
> 
> The below fix (untested) should be able to fix it.

Did you read the rest of the thread on this?  If the page is being
migrated, we should still account it ... also, you've changed the
refcount, so this:

        if (page_count(page) == 1) {
                smaps_page_accumulate(mss, page, size, size << PSS_SHIFT, dirty,
                        locked, true);
                return;
        }

will never trigger.

  reply	other threads:[~2021-12-21 18:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  0:53 [syzbot] kernel BUG in __page_mapcount syzbot
2021-06-07 17:27 ` split_huge_page_to_list() races with page_mapcount() on migration entry in smaps code? [was: Re: [syzbot] kernel BUG in __page_mapcount] Jann Horn
2021-06-07 18:03   ` Matthew Wilcox
2021-06-07 19:55     ` Jann Horn
2021-06-07 20:20       ` Matthew Wilcox
2021-06-07 20:49   ` Kirill A. Shutemov
2021-12-21 17:24 ` [syzbot] kernel BUG in __page_mapcount syzbot
2021-12-21 18:24   ` Yang Shi
2021-12-21 18:40     ` Matthew Wilcox [this message]
2021-12-21 19:07       ` Yang Shi
2021-12-22  1:42         ` Yang Shi
2022-01-05 19:05       ` Yang Shi
2022-01-11 23:14         ` Yang Shi

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=YcIfj3nfuL0kzkFO@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=chinwen.chang@mediatek.com \
    --cc=fgheet255t@gmail.com \
    --cc=jannh@google.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shy828301@gmail.com \
    --cc=syzbot+1f52b3a18d5633fa7f82@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tonymarislogistics@yandex.com \
    --cc=vbabka@suse.cz \
    --cc=walken@google.com \
    --cc=ziy@nvidia.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.