Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/miscfs/genfs genfs_do_getpages_xip: Drop vmobjloc...



details:   https://anonhg.NetBSD.org/src/rev/0bfe93c4047c
branches:  uebayasi-xip
changeset: 751593:0bfe93c4047c
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Tue Feb 23 07:46:28 2010 +0000

description:
genfs_do_getpages_xip: Drop vmobjlock before calling VOP_BMAP, otherwise
deadlock.  No idea how this worked for me before.

Directly call uvm_phys_to_vm_page_device() to make a device page cookie.

diffstat:

 sys/miscfs/genfs/genfs_io.c |  21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diffs (71 lines):

diff -r 7c3bb638dda5 -r 0bfe93c4047c sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Tue Feb 23 07:44:25 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Tue Feb 23 07:46:28 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.36.2.1 2010/02/11 06:23:04 uebayasi Exp $       */
+/*     $NetBSD: genfs_io.c,v 1.36.2.2 2010/02/23 07:46:28 uebayasi Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,8 +31,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.1 2010/02/11 06:23:04 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.2 2010/02/23 07:46:28 uebayasi Exp $");
 
+#include "opt_device_page.h"
 #include "opt_xip.h"
 
 #include <sys/param.h>
@@ -767,9 +768,9 @@
        int i;
        paddr_t phys_addr;
 
-       KASSERT((vp->v_vflag & VV_XIP) != 0);
+       UVMHIST_FUNC("genfs_do_getpages_xip"); UVMHIST_CALLED(ubchist);
 
-       UVMHIST_LOG(ubchist, "xip!", 0, 0, 0, 0);
+       KASSERT((vp->v_vflag & VV_XIP) != 0);
 
        /* XXXUEBS should we care about PGO_LOCKED? */
 
@@ -786,6 +787,9 @@
 
        UVMHIST_LOG(ubchist, "xip npages=%d sbkoff=%lx ebkoff=%lx", npages, (long)sbkoff, (long)ebkoff, 0);
 
+       if ((flags & PGO_LOCKED) == 0)
+               mutex_exit(&uobj->vmobjlock);
+
        /* XXX optimize */
        off = offset;
        i = 0;
@@ -809,17 +813,13 @@
                            (off - (lbn << fs_bshift));
                }
 
-               pps[i] = PHYS_TO_VM_PAGE(phys_addr);
+               pps[i] = uvm_phys_to_vm_page_device(phys_addr);
 
                UVMHIST_LOG(ubchist, "xip pgs %d => phys_addr=0x%lx (%p)",
                        i,
                        (long)phys_addr,
                        pps[i],
                        0);
-               printf("xip pgs %d => phys_addr=0x%lx (%p)\n",
-                       i,
-                       (long)phys_addr,
-                       pps[i]);
 
                off += PAGE_SIZE;
                i++;
@@ -827,9 +827,6 @@
 
        *npagesp = i;
 
-       if ((flags & PGO_LOCKED) == 0)
-               mutex_exit(&uobj->vmobjlock);
-
        return 0;
 }
 #endif



Home | Main Index | Thread Index | Old Index