Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm ubc_direct_release(): unbusy the pages directly sinc...



details:   https://anonhg.NetBSD.org/src/rev/48f7ce51d0ea
branches:  trunk
changeset: 1009462:48f7ce51d0ea
user:      ad <ad%NetBSD.org@localhost>
date:      Thu Apr 23 21:12:06 2020 +0000

description:
ubc_direct_release(): unbusy the pages directly since pg->interlock is
being taken.

diffstat:

 sys/uvm/uvm_bio.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r fde94fd533b8 -r 48f7ce51d0ea sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Thu Apr 23 20:38:33 2020 +0000
+++ b/sys/uvm/uvm_bio.c Thu Apr 23 21:12:06 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_bio.c,v 1.108 2020/04/07 19:12:25 ad Exp $ */
+/*     $NetBSD: uvm_bio.c,v 1.109 2020/04/23 21:12:06 ad Exp $ */
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.108 2020/04/07 19:12:25 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.109 2020/04/23 21:12:06 ad Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -910,8 +910,16 @@
        for (int i = 0; i < npages; i++) {
                struct vm_page *pg = pgs[i];
 
+               pg->flags &= ~PG_BUSY;
+               UVM_PAGE_OWN(pg, NULL);
+               if (pg->flags & PG_RELEASED) {
+                       pg->flags &= ~PG_RELEASED;
+                       uvm_pagefree(pg);
+                       continue;
+               }
                uvm_pagelock(pg);
                uvm_pageactivate(pg);
+               uvm_pagewakeup(pg);
                uvm_pageunlock(pg);
 
                /* Page was changed, no longer fake and neither clean. */
@@ -922,7 +930,6 @@
                            "page %p not dirty", pg);
                }
        }
-       uvm_page_unbusy(pgs, npages);
        rw_exit(uobj->vmobjlock);
 }
 



Home | Main Index | Thread Index | Old Index