On 09/09/22(Fri) 14:41, Martin Pieuchot wrote: > On 09/09/22(Fri) 12:25, Theo Buehler wrote: > > > Yesterday gnezdo@ fixed a race in uvn_attach() that lead to the same > > > assert. Here's an rebased diff for the bug discussed in this thread, > > > could you try again and let us know? Thanks! > > > > This seems to be stable now. It's been running for nearly 5 days. > > Without gnezdo's fix it would blow up within at most 2 days. > > Thanks! I'm looking for oks then.
Here's an alternative possible fix. The previous one got reverted because it exposes a bug on arm64 machines with Cortex-A72 CPUs. The idea of the diff below is to flush data to physical pages that we keep around when munmap(2) is called. I hope that the page daemon does the right thing and don't try to grab a reference to the vnode if all pages are PG_CLEAN. Could you try that and tell me if this prevents the panic you're seeing? 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 9 Nov 2022 16:08:57 -0000 @@ -329,7 +329,7 @@ uvn_detach(struct uvm_object *uobj) */ if (uvn->u_flags & UVM_VNODE_CANPERSIST) { /* won't block */ - uvn_flush(uobj, 0, 0, PGO_DEACTIVATE|PGO_ALLPAGES); + uvn_flush(uobj, 0, 0, PGO_CLEANIT|PGO_DEACTIVATE|PGO_ALLPAGES); goto out; }