From: Andrew Morton <akpm@linux-foundation.org>
To: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
David Hildenbrand <david@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-nilfs <linux-nilfs@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: nilfs: WARNING: CPU: 2 PID: 1510 at include/linux/backing-dev.h:269 __folio_mark_dirty+0x31d/0x3b0
Date: Sat, 12 Mar 2022 22:23:51 -0800 [thread overview]
Message-ID: <20220312222351.89844f74d3cf10212f308caf@linux-foundation.org> (raw)
In-Reply-To: <CAKFNMonQtBe=pjrUuACqzKL36RTWmvoULwzD9NCP7PET8B73bQ@mail.gmail.com>
On Sun, 13 Mar 2022 15:09:27 +0900 Ryusuke Konishi <konishi.ryusuke@gmail.com> wrote:
> Hi Matthew, and Andrew,
>
> On Sat, Mar 12, 2022 at 7:56 AM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > On Fri, Mar 11, 2022 at 08:43:57PM +0100, David Hildenbrand wrote:
> > > Hi,
> > >
> > > playing with swapfiles on random file systems, I stumbled over the
> > > following nilfs issue (and reproduced it on latest greatest
> > > linux/master -- v5.17-rc7+). I did not try finding out when this
> > > was introduced and I did not run into this issue on other file
> > > systems I tried.
> >
> > It's a known bug in NILFS, and I think yours is the fifth report
> > of it dating back eight months.
>
> The root cause of this issue is that NILFS uses two page caches
> per inode, one for data blocks and another for b-tree node blocks.
>
> Even though __folio_end_writeback(), __folio_start_writeback(), and
> __folio_mark_dirty() acquire lock for mapping->i_pages,
> inode_to_wb(inode) inside them performs lockdep test for the former one
> (i.e. inode->i_mapping->i_pages.xa_lock).
>
> So, mark_buffer_dirty(), end_page_writeback(), and set_page_writeback()
> for pages in the latter NILFS specific page cache hit the LOCKDEP warning.
>
> I tried to find a way to resolve this, but have no good idea so far.
If things are set up appropriately, inode_to_wb() should be able to
test inode->i_mapping->host->i_mapping->i_pages.xa_lock and get the
desired result.
At least, that's the case with blockdevs. I don't know if nilfs2 sets
things up that way.
next prev parent reply other threads:[~2022-03-13 6:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 19:43 David Hildenbrand
2022-03-11 22:56 ` Matthew Wilcox
2022-03-13 6:09 ` Ryusuke Konishi
2022-03-13 6:23 ` Andrew Morton [this message]
2022-03-13 7:28 ` Ryusuke Konishi
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=20220312222351.89844f74d3cf10212f308caf@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=konishi.ryusuke@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nilfs@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--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