On 06/05/22(Fri) 22:16, Alexander Bluhm wrote:
> Same with this diff.

Thanks for testing.  Here's a possible fix.  The idea is to call
uvm_vnp_terminate() when recycling a vnode.  This will flush any
pending pages that are still associated with the vnode.  Ironically that
is what the comment above uvm_vnp_terminate() says, even if this has
never been true.

I find this approach less intrusive than removing the CANPERSIST flag.
I'd suggest we do that later.

Andrew, Alexander, could you test this and report back?

Thanks!

Index: kern/vfs_subr.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.315
diff -u -p -r1.315 vfs_subr.c
--- kern/vfs_subr.c     27 Mar 2022 16:19:39 -0000      1.315
+++ kern/vfs_subr.c     17 May 2022 15:28:30 -0000
@@ -459,6 +459,10 @@ getnewvnode(enum vtagtype tag, struct mo
                vp->v_flag = 0;
                vp->v_socket = NULL;
        }
+       /*
+        * Clean out any VM data associated with the vnode.
+        */
+       uvm_vnp_terminate(vp);
        cache_purge(vp);
        vp->v_type = VNON;
        vp->v_tag = tag;

Reply via email to