From: Theo Buehler Subject: Re: Introduce uvmfault_promote() To: tech@openbsd.org Date: Sat, 30 Nov 2024 14:26:02 +0100 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. 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.