linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hillf Danton <hdanton@sina.com>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	syzbot <syzbot+c48f34012b06c4ac67dd@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzkaller-bugs@googlegroups.com,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Jens Axboe <axboe@kernel.dk>,
	Markus Elfring <Markus.Elfring@web.de>
Subject: Re: kernel BUG at include/linux/swapops.h:LINE!
Date: Mon, 27 Jul 2020 22:46:56 +0800	[thread overview]
Message-ID: <20200727144656.15200-1-hdanton@sina.com> (raw)
In-Reply-To: <20200727134446.GL23808@casper.infradead.org>


On Mon, 27 Jul 2020 14:44:46 +0100 Matthew Wilcox wrote:
> On Mon, Jul 27, 2020 at 08:59:50PM +0800, Hillf Danton wrote:
> > Can you elaborate on the difference between the two dumps?
> 
> You didn't trim anything, so I have no idea which two dumps you mean.
> 
> I'll annotate below ...

Double thanks.
> 
> > > > On Sun, Jul 26, 2020 at 05:49:04PM +0100, Matthew Wilcox wrote:
> > > > > 1457 086 (20181): drop_caches: 3
> > > > > 1457 page:00000000a216ae9a refcount:2 mapcount:0 mapping:000000009ba7bfed index:0x2227 pfn:0x229e7
> > > > > 1457 aops:def_blk_aops ino:0
> > > > > 1457 flags: 0x4000000000002030(lru|active|private)
> > > > > 1457 raw: 4000000000002030 fffff5b4416b5a48 fffff5b4408a7988 ffff9e9c34848578
> > > > > 1457 raw: 0000000000002227 ffff9e9bd18f0d00 00000002ffffffff 0000000000000000
> > > > > 1457 page dumped because: not locked
> > > > > 1457 swap entry 30.229e7
> 
> This is a dump of the page that was found when looking up the migration entry.

It can be understood without difficulty as page(with mapping) is not locked.
> 
> > On Mon, 27 Jul 2020 13:03:10 +0100 Matthew Wilcox wrote:
> > > It's not mapped with a PMD.  I tweaked my debugging slightly:
> > > 
> > >  static inline swp_entry_t make_migration_entry(struct page *page, int write)
> > >  {
> > > -       BUG_ON(!PageLocked(compound_head(page)));
> > > +       VM_BUG_ON_PAGE(!PageLocked(page), page);
> > >  
> > > +if (PageHead(page)) dump_page(page, "make entry");
> > > +if (PageTail(page)) printk("pfn %lx order %d\n", page_to_pfn(page), thp_order(thp_head(page)));
> > > 
> > > 1523 page:0000000006f62206 refcount:490 mapcount:1 mapping:0000000000000000 index:0x562b12a00 pfn:0x1dc00
> > > 1523 head:0000000006f62206 order:9 compound_mapcount:0 compound_pincount:0
> > > 1523 anon flags: 0x400000000009003d(locked|uptodate|dirty|lru|active|head|swapbacked)
> > > 1523 raw: 400000000009003d ffffecfd41301308 ffffecfd41b08008 ffff9e9971c00059
> > > 1523 raw: 0000000562b12a00 0000000000000000 000001ea00000000 0000000000000000
> > > 1523 page dumped because: make entry
> 
> This is dumping the page when we create the entry.

Hard to understand that a locked page is dumped.
> 
> For completeness, here's the page that we find from the same run.
> 
> 1523 page:00000000a18100e6 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1ddde
> 1523 flags: 0x4000000000000000()
> 1523 raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000
> 1523 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
> 1523 page dumped because: not locked
> 
> (an order-9 page will occupy PFNs 0x1dc00-0x1ddff)
> 
> It's clearly been freed and is still sitting on the per-CPU free list.

As it survived free, it is simple to see refcount or lock; what's
unclear is why there is a migrate entry left two miles behind, anon or
not.

> I've also seen them as PageBuddy and, as in the first example above,
> reallocated to a different user.



  reply	other threads:[~2020-07-27 14:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 17:05 kernel BUG at include/linux/swapops.h:LINE! syzbot
2020-07-19 21:10 ` syzbot
2020-07-20 23:51   ` Andrew Morton
2020-07-21  0:21     ` Matthew Wilcox
2020-07-21  2:14       ` Matthew Wilcox
2020-07-21 11:11     ` Kirill A. Shutemov
2020-07-21 15:11       ` Jens Axboe
2020-07-23  7:37       ` Hillf Danton
2020-07-24 11:13         ` Kirill A. Shutemov
2020-07-26 16:49           ` Matthew Wilcox
2020-07-27 10:31             ` Kirill A. Shutemov
2020-07-27 12:03               ` Matthew Wilcox
2020-07-27 12:59                 ` Hillf Danton
2020-07-27 13:44                   ` Matthew Wilcox
2020-07-27 14:46                     ` Hillf Danton [this message]
2020-07-29 19:21                 ` Kirill A. Shutemov
2020-07-29 19:54                   ` Matthew Wilcox
2020-07-29 22:11                     ` Matthew Wilcox
2021-05-08 11:24 ` [syzbot] " 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=20200727144656.15200-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=Markus.Elfring@web.de \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hannes@cmpxchg.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=syzbot+c48f34012b06c4ac67dd@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=willy@infradead.org \
    /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).