From: Martin Pieuchot Subject: Re: fail earlier in pgo_get To: tech@openbsd.org Date: Sat, 8 Nov 2025 17:23:34 +0000 On 27/10/25(Mon) 10:34, Martin Pieuchot wrote: > Stop iterating as soon as a page is missing or busy when all pages are > asked by the caller. > > Note that currently pgo_get() is not called with PGO_ALLPAGES in the > kernel. This is a requirement for upcoming changes. > > ok? Anyone? > Index: uvm/uvm_aobj.c > =================================================================== > RCS file: /cvs/src/sys/uvm/uvm_aobj.c,v > diff -u -p -r1.116 uvm_aobj.c > --- uvm/uvm_aobj.c 10 Mar 2025 14:13:58 -0000 1.116 > +++ uvm/uvm_aobj.c 27 Oct 2025 09:31:40 -0000 > @@ -1024,10 +1024,13 @@ uao_get(struct uvm_object *uobj, voff_t > * to be useful must get a non-busy page > */ > if (ptmp == NULL || (ptmp->pg_flags & PG_BUSY) != 0) { > - if (lcv == centeridx || > - (flags & PGO_ALLPAGES) != 0) > + if (lcv == centeridx) > /* need to do a wait or I/O! */ > done = FALSE; > + if ((flags & PGO_ALLPAGES) != 0) { > + done = FALSE; > + break; > + } > continue; > } > > Index: uvm/uvm_vnode.c > =================================================================== > RCS file: /cvs/src/sys/uvm/uvm_vnode.c,v > diff -u -p -r1.142 uvm_vnode.c > --- uvm/uvm_vnode.c 29 Sep 2025 09:55:01 -0000 1.142 > +++ uvm/uvm_vnode.c 27 Oct 2025 09:32:09 -0000 > @@ -977,10 +990,13 @@ uvn_get(struct uvm_object *uobj, voff_t > * to be useful must get a non-busy page > */ > if (ptmp == NULL || (ptmp->pg_flags & PG_BUSY) != 0) { > - if (lcv == centeridx || > - (flags & PGO_ALLPAGES) != 0) > + if (lcv == centeridx) > /* need to do a wait or I/O! */ > done = FALSE; > + if ((flags & PGO_ALLPAGES) != 0) { > + done = FALSE; > + break; > + } > continue; > } > > >