On Mon, Nov 28, 2022 at 03:04:17PM +0100, Mark Kettenis wrote: > So here is an updated diff that checks the UVM_VNODE_DYING flag and > skips the refcount manipulation if it is set.
My macppc has build a full release with it. So it seems to fix the issue. I will continue testing. I also made a performance comparison with kettenis@ and mpi@ diff. http://bluhm.genua.de/perform/results/2022-12-05T17:42:17Z/perform.html The only relevant part is the make-bsd-j8 test. There I see 2% less system time with kettenis@ diff. So building kernel is faster. But such small differences have to be interpreted with care. > What do you think? We should try and commit this. bluhm > Index: uvm/uvm_vnode.c > =================================================================== > RCS file: /cvs/src/sys/uvm/uvm_vnode.c,v > retrieving revision 1.130 > diff -u -p -r1.130 uvm_vnode.c > --- uvm/uvm_vnode.c 20 Oct 2022 13:31:52 -0000 1.130 > +++ uvm/uvm_vnode.c 28 Nov 2022 14:01:20 -0000 > @@ -899,11 +899,21 @@ uvn_cluster(struct uvm_object *uobj, vof > int > uvn_put(struct uvm_object *uobj, struct vm_page **pps, int npages, int flags) > { > - int retval; > + struct uvm_vnode *uvn = (struct uvm_vnode *)uobj; > + int dying, retval; > > KASSERT(rw_write_held(uobj->vmobjlock)); > > + dying = (uvn->u_flags & UVM_VNODE_DYING); > + if (!dying) { > + if (vget(uvn->u_vnode, LK_NOWAIT)) > + return VM_PAGER_AGAIN; > + } > + > retval = uvn_io((struct uvm_vnode*)uobj, pps, npages, flags, UIO_WRITE); > + > + if (!dying) > + vrele(uvn->u_vnode); > > return retval; > } > >