Re: WARNING: at mm/mremap.c:211 move_page_tables in i386

Linus Torvalds
2020-07-13T03:53:09Z

On Sun, Jul 12, 2020 at 7:53 PM Joel Fernandes <joel@joelfernandes.org> wrote:
>
> > But I do feel like you figured out why the bug happened, now we're
> > just discussing whether the patch is the right thing to do.
>
> Yes.
>
> > Maybe saying "doing the pmd copies for the initial stack isn't
> > important, so let's just note this as a special case and get rid of
> > the WARN_ON()" might be an alternative solution.
>
> Personally, I feel it is better to keep the warning just so in the future we
> can detect any bugs.

I don't disagree, the warning didn't happen to find a bug now, but it
did fine a case we might be able to do better.

So now that I feel we understand the issue, and it's not a horrible
problem, just a (very hard to trigger) warning, I don't think there's
any huge hurry.

I think think I will - for now - change the WARN_ON() to
WARN_ON_ONCE() (so that it doesn't floow the logs if somebody triggers
this odd special case this malisiously), and add a note about how
this happens to the code for posterito.

And if/when you figure out a better way to fix it, we can update the note.

Ok?

Linus