Source-Changes-HG archive

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

[src/trunk]: src/sys Defer to synchronous I/O before the aiodone work queue e...



details:   https://anonhg.NetBSD.org/src/rev/ce740c318640
branches:  trunk
changeset: 845564:ce740c318640
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Oct 06 05:48:00 2019 +0000

description:
Defer to synchronous I/O before the aiodone work queue exists.

diffstat:

 sys/miscfs/genfs/genfs_io.c |  9 +++++++--
 sys/uvm/uvm_swap.c          |  9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r 811812455e25 -r ce740c318640 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Sun Oct 06 02:30:58 2019 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Sun Oct 06 05:48:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $       */
+/*     $NetBSD: genfs_io.c,v 1.76 2019/10/06 05:48:00 mlelstv Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.75 2019/07/11 16:59:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.76 2019/10/06 05:48:00 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -561,6 +561,9 @@
        if (kva == 0)
                return EBUSY;
 
+       if (uvm.aiodone_queue == NULL)
+               async = 0;
+
        mbp = getiobuf(vp, true);
        mbp->b_bufsize = totalbytes;
        mbp->b_data = (void *)kva;
@@ -1377,6 +1380,7 @@
            UVMPAGER_MAPIN_WRITE | UVMPAGER_MAPIN_WAITOK);
        len = npages << PAGE_SHIFT;
 
+       KASSERT(uvm.aiodone_queue != NULL);
        error = genfs_do_io(vp, off, kva, len, flags, UIO_WRITE,
                            uvm_aio_biodone);
 
@@ -1400,6 +1404,7 @@
            UVMPAGER_MAPIN_READ | UVMPAGER_MAPIN_WAITOK);
        len = npages << PAGE_SHIFT;
 
+       KASSERT(uvm.aiodone_queue != NULL);
        error = genfs_do_io(vp, off, kva, len, flags, UIO_WRITE,
                            uvm_aio_biodone);
 
diff -r 811812455e25 -r ce740c318640 sys/uvm/uvm_swap.c
--- a/sys/uvm/uvm_swap.c        Sun Oct 06 02:30:58 2019 +0000
+++ b/sys/uvm/uvm_swap.c        Sun Oct 06 05:48:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_swap.c,v 1.180 2019/01/27 05:22:19 kre Exp $       */
+/*     $NetBSD: uvm_swap.c,v 1.181 2019/10/06 05:48:00 mlelstv Exp $   */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.180 2019/01/27 05:22:19 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.181 2019/10/06 05:48:00 mlelstv Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_compat_netbsd.h"
@@ -1778,6 +1778,10 @@
        write = (flags & B_READ) == 0;
        async = (flags & B_ASYNC) != 0;
 
+       /* XXX swap io make take place before the aiodone queue exists */
+       if (uvm.aiodone_queue == NULL)
+               async = 0;
+
        /*
         * allocate a buf for the i/o.
         */
@@ -1832,6 +1836,7 @@
         */
 
        if (async) {
+               KASSERT(uvm.aiodone_queue != NULL);
                bp->b_iodone = uvm_aio_biodone;
                UVMHIST_LOG(pdhist, "doing async!", 0, 0, 0, 0);
                if (curlwp == uvm.pagedaemon_lwp)



Home | Main Index | Thread Index | Old Index