On 02/06/22(Thu) 07:29, Theo de Raadt wrote: > So this basically converts the flag into a proper reference?
It completely gets rid of the extra reference. UVM objects related to a vnode are no longer kept alive after uvn_detach() has been called. > If you go back to 4.4BSD, there's another aspect which was different: > I believe vnodes weren't allocated dynamically, but came out of a fixed > and therefore the recycling behaviour was different. Or maybe some > kernel code had a subtle use-after-free mistake? Indeed the PERSIST flag has been inherited/copied from 4.4BSD vm where objects where kept in a global cache data structure. It isn't clear to me why this logic has been kept in UVM.
