Re: [PATCH v2 4/6] shmem: skip page split if we're not reclaiming

From: Hugh Dickins
Date: Tue Apr 18 2023 - 17:21:14 EST


On Tue, 18 Apr 2023, Luis Chamberlain wrote:
> On Mon, Apr 17, 2023 at 09:41:41PM -0700, Hugh Dickins wrote:
> > On Thu, 9 Mar 2023, Luis Chamberlain wrote:
> >
> > > + if (WARN_ON_ONCE(info->flags & VM_LOCKED))
> > > + goto redirty;
> >
> > Well, okay, I don't mind that. But shall we take bets on how soon syzbot
> > (hope it's not watching) will try flipping SHM_LOCK on while swapping out
> > pages from a SHM segment, and hit that warning? Perhaps I'm wrong, but I
> > don't think any serialization prevents that.
>
> I though that may be the case. Would such serialization be welcomed?

Absolutely not! We don't insert slowdowns just to avoid warnings,
unless the warning is of something that really matters. This one
does not matter, the situation is correctly handled, so the warning
would be better reverted. Though I personally don't mind you leaving
it in until the first report of it arrives.

Hugh