[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHk-=wiavm+uTti1SmuwvBQyu-0OC_6c3Y1v7kpunmPnjVRsSQ@mail.gmail.com>
Date: Wed, 25 Nov 2020 14:01:03 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Hugh Dickins <hughd@...gle.com>
Cc: Matthew Wilcox <willy@...radead.org>, Jan Kara <jack@...e.cz>,
syzbot <syzbot+3622cea378100f45d59f@...kaller.appspotmail.com>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Ext4 Developers List <linux-ext4@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
"Theodore Ts'o" <tytso@....edu>, Linux-MM <linux-mm@...ck.org>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Nicholas Piggin <npiggin@...il.com>,
Alex Shi <alex.shi@...ux.alibaba.com>, Qian Cai <cai@....pw>,
Christoph Hellwig <hch@...radead.org>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
William Kucharski <william.kucharski@...cle.com>,
Jens Axboe <axboe@...nel.dk>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-xfs <linux-xfs@...r.kernel.org>
Subject: Re: kernel BUG at fs/ext4/inode.c:LINE!
On Wed, Nov 25, 2020 at 1:30 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> I'm not sure I'm willing to write and test the real patch, but it
> doesn't look _too_ nasty from just looking at the code. The bookmark
> thing makes it important to only actually clear the bit at the end (as
> does the handoff case anyway), but the way wake_up_page_bit() is
> written, that's actually very straightforward - just after the
> while-loop. That's when we've woken up everybody.
Actually, there's a problem. We don't know if we've done the hand-off
or not, so we don't know if we should clear the bit after waking
everybody up or not.
We set that WQ_FLAG_DONE bit for the hand-0off case, but only the
woken party sees that - the waker itself doesn't know about it (and we
have no good way to return it in that call chain: wake_up_page_bit ->
__wake_up_locked_key_bookmark -> __wake_up_common ->
wake_page_function().
We could easily hide the flag in the "bookmark" wait queue entry, but
that smells a bit hacky to me.
So I don't think it's worth it, unless somebody really wants to give it a try.
But if it turns out that the page ref change from Hugh causes some
unexpected problem, we do have this model as a backup.
Linus
Powered by blists - more mailing lists