Index | Thread | Search

From:
Martin Pieuchot <mpi@grenadille.net>
Subject:
Re: Introduce uvmfault_promote()
To:
Theo Buehler <tb@openbsd.org>
Cc:
tech@openbsd.org
Date:
Sat, 30 Nov 2024 15:07:40 +0100

Download raw body.

Thread
On 30/11/24(Sat) 14:26, Theo Buehler wrote:
> On Sat, Nov 30, 2024 at 01:17:49PM +0100, Martin Pieuchot wrote:
> > Diff below introduces a new function to merge common code used to
> > promote data to a new anon.
> > 
> > It is used for 3 different cases:
> > 
> > - CoW of an anon, `uobjpage' is set to oanon->an_page
> > - Zero fill of a new page, `uobjpage' is set to PGO_DONTCARE
> > - CoW of a uobj page, `uobjpage` is set to the center fetched by pgo_get()
> > 
> > This diff doesn't introduce any change in behavior.   More merging will
> > come afterwards.
> 
> One tiny change of behavior is that uvm_wait() is no longer called with
> "flt_noram5" in the second caller.

Indeed.

> More importantly, on error in the lower fault case, the order of the
> "unlock everything" step in uvmfault_promote() and the "arg!" step of
> unbusying the uobjpage is reversed.
> 
> It is not obvious to me why this is entirely benign, but assuming that
> it is, this change seems fine.

Actually it is not.  Thanks for reviewing.  I'll have to send the ugly
diff first.  This will disappear.