Module Name: src Committed By: chs Date: Tue Feb 18 20:23:18 UTC 2020
Modified Files: src/sys/kern: init_main.c src/sys/miscfs/genfs: genfs_io.c src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: vm_vfs.c src/sys/ufs/lfs: lfs_bio.c lfs_extern.h lfs_inode.h lfs_segment.c lfs_syscalls.c lfs_vfsops.c src/sys/uvm: uvm.h uvm_extern.h uvm_pager.c uvm_pdaemon.c uvm_swap.c Log Message: remove the aiodoned thread. I originally added this to provide a thread context for doing page cache iodone work, but since then biodone() has changed to hand off all iodone work to a softint thread, so we no longer need the special-purpose aiodoned thread. To generate a diff of this commit: cvs rdiff -u -r1.520 -r1.521 src/sys/kern/init_main.c cvs rdiff -u -r1.84 -r1.85 src/sys/miscfs/genfs/genfs_io.c cvs rdiff -u -r1.340 -r1.341 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.36 -r1.37 src/sys/rump/librump/rumpvfs/vm_vfs.c cvs rdiff -u -r1.144 -r1.145 src/sys/ufs/lfs/lfs_bio.c cvs rdiff -u -r1.114 -r1.115 src/sys/ufs/lfs/lfs_extern.h cvs rdiff -u -r1.23 -r1.24 src/sys/ufs/lfs/lfs_inode.h cvs rdiff -u -r1.281 -r1.282 src/sys/ufs/lfs/lfs_segment.c cvs rdiff -u -r1.175 -r1.176 src/sys/ufs/lfs/lfs_syscalls.c cvs rdiff -u -r1.369 -r1.370 src/sys/ufs/lfs/lfs_vfsops.c cvs rdiff -u -r1.73 -r1.74 src/sys/uvm/uvm.h cvs rdiff -u -r1.219 -r1.220 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.120 -r1.121 src/sys/uvm/uvm_pager.c cvs rdiff -u -r1.123 -r1.124 src/sys/uvm/uvm_pdaemon.c cvs rdiff -u -r1.185 -r1.186 src/sys/uvm/uvm_swap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/init_main.c diff -u src/sys/kern/init_main.c:1.520 src/sys/kern/init_main.c:1.521 --- src/sys/kern/init_main.c:1.520 Sat Feb 15 18:12:15 2020 +++ src/sys/kern/init_main.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.520 2020/02/15 18:12:15 ad Exp $ */ +/* $NetBSD: init_main.c,v 1.521 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.520 2020/02/15 18:12:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.521 2020/02/18 20:23:17 chs Exp $"); #include "opt_ddb.h" #include "opt_inet.h" @@ -720,11 +720,6 @@ main(void) NULL, NULL, "ioflush")) panic("fork syncer"); - /* Create the aiodone daemon kernel thread. */ - if (workqueue_create(&uvm.aiodone_queue, "aiodoned", - uvm_aiodone_worker, NULL, PRI_VM, IPL_NONE, WQ_MPSAFE)) - panic("fork aiodoned"); - /* Wait for final configure threads to complete. */ config_finalize_mountroot(); Index: src/sys/miscfs/genfs/genfs_io.c diff -u src/sys/miscfs/genfs/genfs_io.c:1.84 src/sys/miscfs/genfs/genfs_io.c:1.85 --- src/sys/miscfs/genfs/genfs_io.c:1.84 Wed Jan 15 17:55:44 2020 +++ src/sys/miscfs/genfs/genfs_io.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: genfs_io.c,v 1.84 2020/01/15 17:55:44 ad Exp $ */ +/* $NetBSD: genfs_io.c,v 1.85 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.84 2020/01/15 17:55:44 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.85 2020/02/18 20:23:17 chs Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -606,9 +606,6 @@ genfs_getpages_read(struct vnode *vp, st 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; @@ -616,7 +613,7 @@ genfs_getpages_read(struct vnode *vp, st mbp->b_cflags = BC_BUSY; if (async) { mbp->b_flags = B_READ | B_ASYNC; - mbp->b_iodone = uvm_aio_biodone; + mbp->b_iodone = uvm_aio_aiodone; } else { mbp->b_flags = B_READ; mbp->b_iodone = NULL; @@ -1396,9 +1393,8 @@ genfs_gop_write(struct vnode *vp, struct 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); + uvm_aio_aiodone); return error; } @@ -1429,9 +1425,8 @@ genfs_gop_write_rwmap(struct vnode *vp, 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); + uvm_aio_aiodone); return error; } Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.340 src/sys/rump/librump/rumpkern/rump.c:1.341 --- src/sys/rump/librump/rumpkern/rump.c:1.340 Mon Feb 10 03:23:29 2020 +++ src/sys/rump/librump/rumpkern/rump.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.340 2020/02/10 03:23:29 riastradh Exp $ */ +/* $NetBSD: rump.c,v 1.341 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.340 2020/02/10 03:23:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.341 2020/02/18 20:23:17 chs Exp $"); #include <sys/systm.h> #define ELFSIZE ARCH_ELFSIZE @@ -116,15 +116,6 @@ bool rump_ttycomponent = false; pool_cache_t pnbuf_cache; -static void -rump_aiodone_worker(struct work *wk, void *dummy) -{ - struct buf *bp = (struct buf *)wk; - - KASSERT(&bp->b_work == wk); - bp->b_iodone(bp); -} - static int rump_inited; void (*rump_vfs_drainbufs)(int) = (void *)nullop; @@ -460,13 +451,6 @@ rump_init(void) cold = 0; - /* aieeeedondest */ - if (rump_threads) { - if (workqueue_create(&uvm.aiodone_queue, "aiodoned", - rump_aiodone_worker, NULL, 0, 0, WQ_MPSAFE)) - panic("aiodoned"); - } - sysctl_finalize(); module_init_class(MODULE_CLASS_ANY); Index: src/sys/rump/librump/rumpvfs/vm_vfs.c diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.36 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.37 --- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.36 Wed Jan 15 17:55:44 2020 +++ src/sys/rump/librump/rumpvfs/vm_vfs.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_vfs.c,v 1.36 2020/01/15 17:55:44 ad Exp $ */ +/* $NetBSD: vm_vfs.c,v 1.37 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 2008-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.36 2020/01/15 17:55:44 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.37 2020/02/18 20:23:17 chs Exp $"); #include <sys/param.h> @@ -90,13 +90,6 @@ uvm_aio_aiodone(struct buf *bp) kmem_free(pgs, npages * sizeof(*pgs)); } -void -uvm_aio_biodone(struct buf *bp) -{ - - uvm_aio_aiodone(bp); -} - /* * UBC */ Index: src/sys/ufs/lfs/lfs_bio.c diff -u src/sys/ufs/lfs/lfs_bio.c:1.144 src/sys/ufs/lfs/lfs_bio.c:1.145 --- src/sys/ufs/lfs/lfs_bio.c:1.144 Tue Dec 31 13:07:14 2019 +++ src/sys/ufs/lfs/lfs_bio.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_bio.c,v 1.144 2019/12/31 13:07:14 ad Exp $ */ +/* $NetBSD: lfs_bio.c,v 1.145 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.144 2019/12/31 13:07:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.145 2020/02/18 20:23:17 chs Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -729,7 +729,7 @@ lfs_newbuf(struct lfs *fs, struct vnode bp->b_blkno = daddr; bp->b_error = 0; bp->b_resid = 0; - bp->b_iodone = lfs_callback; + bp->b_iodone = lfs_free_aiodone; bp->b_cflags = BC_BUSY | BC_NOCACHE; bp->b_private = fs; Index: src/sys/ufs/lfs/lfs_extern.h diff -u src/sys/ufs/lfs/lfs_extern.h:1.114 src/sys/ufs/lfs/lfs_extern.h:1.115 --- src/sys/ufs/lfs/lfs_extern.h:1.114 Wed Aug 22 01:05:24 2018 +++ src/sys/ufs/lfs/lfs_extern.h Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_extern.h,v 1.114 2018/08/22 01:05:24 msaitoh Exp $ */ +/* $NetBSD: lfs_extern.h,v 1.115 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -197,7 +197,7 @@ int lfs_match_data(struct lfs *, struct int lfs_match_indir(struct lfs *, struct buf *); int lfs_match_dindir(struct lfs *, struct buf *); int lfs_match_tindir(struct lfs *, struct buf *); -void lfs_callback(struct buf *); +void lfs_free_aiodone(struct buf *); void lfs_acquire_finfo(struct lfs *fs, ino_t, int); void lfs_release_finfo(struct lfs *fs); Index: src/sys/ufs/lfs/lfs_inode.h diff -u src/sys/ufs/lfs/lfs_inode.h:1.23 src/sys/ufs/lfs/lfs_inode.h:1.24 --- src/sys/ufs/lfs/lfs_inode.h:1.23 Sat Jun 10 05:29:36 2017 +++ src/sys/ufs/lfs/lfs_inode.h Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_inode.h,v 1.23 2017/06/10 05:29:36 maya Exp $ */ +/* $NetBSD: lfs_inode.h,v 1.24 2020/02/18 20:23:17 chs Exp $ */ /* from NetBSD: ulfs_inode.h,v 1.5 2013/06/06 00:51:50 dholland Exp */ /* from NetBSD: inode.h,v 1.72 2016/06/03 15:36:03 christos Exp */ @@ -214,7 +214,7 @@ struct lfs_inode_ext { #ifdef _KERNEL -# define LFS_IS_MALLOC_BUF(bp) ((bp)->b_iodone == lfs_callback) +# define LFS_IS_MALLOC_BUF(bp) ((bp)->b_iodone == lfs_free_aiodone) /* log for debugging writes to the Ifile */ # ifdef DEBUG Index: src/sys/ufs/lfs/lfs_segment.c diff -u src/sys/ufs/lfs/lfs_segment.c:1.281 src/sys/ufs/lfs/lfs_segment.c:1.282 --- src/sys/ufs/lfs/lfs_segment.c:1.281 Wed Jan 15 17:55:44 2020 +++ src/sys/ufs/lfs/lfs_segment.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_segment.c,v 1.281 2020/01/15 17:55:44 ad Exp $ */ +/* $NetBSD: lfs_segment.c,v 1.282 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.281 2020/01/15 17:55:44 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.282 2020/02/18 20:23:17 chs Exp $"); #ifdef DEBUG # define vndebug(vp, str) do { \ @@ -109,11 +109,8 @@ __KERNEL_RCSID(0, "$NetBSD: lfs_segment. MALLOC_JUSTDEFINE(M_SEGMENT, "LFS segment", "Segment for LFS"); -static void lfs_generic_callback(struct buf *, void (*)(struct buf *)); -static void lfs_free_aiodone(struct buf *); static void lfs_super_aiodone(struct buf *); static void lfs_cluster_aiodone(struct buf *); -static void lfs_cluster_callback(struct buf *); /* * Determine if it's OK to start a partial in this segment, or if we need @@ -136,7 +133,6 @@ static void lfs_cluster_callback(struct int lfs_match_fake(struct lfs *, struct buf *); void lfs_newseg(struct lfs *); -void lfs_supercallback(struct buf *); void lfs_updatemeta(struct segment *); void lfs_writesuper(struct lfs *, daddr_t); int lfs_writevnodes(struct lfs *fs, struct mount *mp, @@ -2007,7 +2003,7 @@ lfs_newclusterbuf(struct lfs *fs, struct bp = getiobuf(vp, true); bp->b_dev = NODEV; bp->b_blkno = bp->b_lblkno = addr; - bp->b_iodone = lfs_cluster_callback; + bp->b_iodone = lfs_cluster_aiodone; bp->b_private = cl; return bp; @@ -2430,7 +2426,7 @@ lfs_writesuper(struct lfs *fs, daddr_t d bp->b_flags = (bp->b_flags & ~B_READ) | B_ASYNC; bp->b_oflags &= ~(BO_DONE | BO_DELWRI); bp->b_error = 0; - bp->b_iodone = lfs_supercallback; + bp->b_iodone = lfs_super_aiodone; if (fs->lfs_sp != NULL && fs->lfs_sp->seg_flags & SEGM_SYNC) BIO_SETPRIO(bp, BPRIO_TIMECRITICAL); @@ -2508,7 +2504,7 @@ lfs_match_tindir(struct lfs *fs, struct return (lbn < 0 && (-lbn - ULFS_NDADDR) % LFS_NINDIR(fs) == 2); } -static void +void lfs_free_aiodone(struct buf *bp) { struct lfs *fs; @@ -2675,43 +2671,6 @@ lfs_cluster_aiodone(struct buf *bp) pool_put(&fs->lfs_clpool, cl); } -static void -lfs_generic_callback(struct buf *bp, void (*aiodone)(struct buf *)) -{ - /* reset b_iodone for when this is a single-buf i/o. */ - bp->b_iodone = aiodone; - - workqueue_enqueue(uvm.aiodone_queue, &bp->b_work, NULL); -} - -static void -lfs_cluster_callback(struct buf *bp) -{ - - lfs_generic_callback(bp, lfs_cluster_aiodone); -} - -void -lfs_supercallback(struct buf *bp) -{ - - lfs_generic_callback(bp, lfs_super_aiodone); -} - -/* - * The only buffers that are going to hit these functions are the - * segment write blocks, or the segment summaries, or the superblocks. - * - * All of the above are created by lfs_newbuf, and so do not need to be - * released via brelse. - */ -void -lfs_callback(struct buf *bp) -{ - - lfs_generic_callback(bp, lfs_free_aiodone); -} - /* * Shellsort (diminishing increment sort) from Data Structures and * Algorithms, Aho, Hopcraft and Ullman, 1983 Edition, page 290; Index: src/sys/ufs/lfs/lfs_syscalls.c diff -u src/sys/ufs/lfs/lfs_syscalls.c:1.175 src/sys/ufs/lfs/lfs_syscalls.c:1.176 --- src/sys/ufs/lfs/lfs_syscalls.c:1.175 Wed Jul 26 16:42:37 2017 +++ src/sys/ufs/lfs/lfs_syscalls.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_syscalls.c,v 1.175 2017/07/26 16:42:37 maya Exp $ */ +/* $NetBSD: lfs_syscalls.c,v 1.176 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007, 2008 @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.175 2017/07/26 16:42:37 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_syscalls.c,v 1.176 2020/02/18 20:23:17 chs Exp $"); #ifndef LFS # define LFS /* for prototypes in syscallargs.h */ @@ -1006,7 +1006,7 @@ lfs_fakebuf(struct lfs *fs, struct vnode lfs_freebuf(fs, bp); return NULL; } - KDASSERT(bp->b_iodone == lfs_callback); + KDASSERT(bp->b_iodone == lfs_free_aiodone); #if 0 mutex_enter(&lfs_lock); Index: src/sys/ufs/lfs/lfs_vfsops.c diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.369 src/sys/ufs/lfs/lfs_vfsops.c:1.370 --- src/sys/ufs/lfs/lfs_vfsops.c:1.369 Fri Jan 17 20:08:10 2020 +++ src/sys/ufs/lfs/lfs_vfsops.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_vfsops.c,v 1.369 2020/01/17 20:08:10 ad Exp $ */ +/* $NetBSD: lfs_vfsops.c,v 1.370 2020/02/18 20:23:17 chs Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007 @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.369 2020/01/17 20:08:10 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.370 2020/02/18 20:23:17 chs Exp $"); #if defined(_KERNEL_OPT) #include "opt_lfs.h" @@ -2113,7 +2113,7 @@ lfs_gop_write(struct vnode *vp, struct v mbp->b_data = (void *)kva; mbp->b_resid = mbp->b_bcount = bytes; mbp->b_cflags = BC_BUSY|BC_AGE; - mbp->b_iodone = uvm_aio_biodone; + mbp->b_iodone = uvm_aio_aiodone; bp = NULL; for (offset = startoffset; Index: src/sys/uvm/uvm.h diff -u src/sys/uvm/uvm.h:1.73 src/sys/uvm/uvm.h:1.74 --- src/sys/uvm/uvm.h:1.73 Tue Dec 31 22:42:51 2019 +++ src/sys/uvm/uvm.h Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm.h,v 1.73 2019/12/31 22:42:51 ad Exp $ */ +/* $NetBSD: uvm.h,v 1.74 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -112,12 +112,6 @@ struct uvm { /* page daemon trigger */ int pagedaemon; /* daemon sleeps on this */ struct lwp *pagedaemon_lwp; /* daemon's lid */ - - /* aiodone daemon */ - struct workqueue *aiodone_queue; - - /* aio_done is locked by uvm.pagedaemon_lock and splbio! */ - TAILQ_HEAD(, buf) aio_done; /* done async i/o reqs */ }; /* Index: src/sys/uvm/uvm_extern.h diff -u src/sys/uvm/uvm_extern.h:1.219 src/sys/uvm/uvm_extern.h:1.220 --- src/sys/uvm/uvm_extern.h:1.219 Wed Jan 15 17:55:45 2020 +++ src/sys/uvm/uvm_extern.h Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_extern.h,v 1.219 2020/01/15 17:55:45 ad Exp $ */ +/* $NetBSD: uvm_extern.h,v 1.220 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -757,7 +757,6 @@ void uvm_pagerealloc(struct vm_page *, void uvm_setpagesize(void); /* uvm_pager.c */ -void uvm_aio_biodone(struct buf *); void uvm_aio_aiodone(struct buf *); void uvm_aio_aiodone_pages(struct vm_page **, int, bool, int); Index: src/sys/uvm/uvm_pager.c diff -u src/sys/uvm/uvm_pager.c:1.120 src/sys/uvm/uvm_pager.c:1.121 --- src/sys/uvm/uvm_pager.c:1.120 Wed Jan 15 17:55:45 2020 +++ src/sys/uvm/uvm_pager.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pager.c,v 1.120 2020/01/15 17:55:45 ad Exp $ */ +/* $NetBSD: uvm_pager.c,v 1.121 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.120 2020/01/15 17:55:45 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.121 2020/02/18 20:23:17 chs Exp $"); #include "opt_uvmhist.h" #include "opt_readahead.h" @@ -146,12 +146,6 @@ uvm_pager_init(void) uvm_pager_realloc_emerg(); /* - * init ASYNC I/O queue - */ - - TAILQ_INIT(&uvm.aio_done); - - /* * call pager init functions */ for (lcv = 0 ; lcv < __arraycount(uvmpagerops); lcv++) { @@ -286,20 +280,6 @@ uvm_pagermapout(vaddr_t kva, int npages) UVMHIST_LOG(maphist,"<- done",0,0,0,0); } -/* - * interrupt-context iodone handler for single-buf i/os - * or the top-level buf of a nested-buf i/o. - */ - -void -uvm_aio_biodone(struct buf *bp) -{ - /* reset b_iodone for when this is a single-buf i/o. */ - bp->b_iodone = uvm_aio_aiodone; - - workqueue_enqueue(uvm.aiodone_queue, &bp->b_work, NULL); -} - void uvm_aio_aiodone_pages(struct vm_page **pgs, int npages, bool write, int error) { Index: src/sys/uvm/uvm_pdaemon.c diff -u src/sys/uvm/uvm_pdaemon.c:1.123 src/sys/uvm/uvm_pdaemon.c:1.124 --- src/sys/uvm/uvm_pdaemon.c:1.123 Wed Jan 15 17:55:45 2020 +++ src/sys/uvm/uvm_pdaemon.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pdaemon.c,v 1.123 2020/01/15 17:55:45 ad Exp $ */ +/* $NetBSD: uvm_pdaemon.c,v 1.124 2020/02/18 20:23:17 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.123 2020/01/15 17:55:45 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.124 2020/02/18 20:23:17 chs Exp $"); #include "opt_uvmhist.h" #include "opt_readahead.h" @@ -342,25 +342,6 @@ uvm_pageout(void *arg) /*NOTREACHED*/ } - -/* - * uvm_aiodone_worker: a workqueue callback for the aiodone daemon. - */ - -void -uvm_aiodone_worker(struct work *wk, void *dummy) -{ - struct buf *bp = (void *)wk; - - KASSERT(&bp->b_work == wk); - - /* - * process an i/o that's done. - */ - - (*bp->b_iodone)(bp); -} - void uvm_pageout_start(int npages) { Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.185 src/sys/uvm/uvm_swap.c:1.186 --- src/sys/uvm/uvm_swap.c:1.185 Fri Dec 27 09:41:51 2019 +++ src/sys/uvm/uvm_swap.c Tue Feb 18 20:23:17 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.185 2019/12/27 09:41:51 msaitoh Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.186 2020/02/18 20:23:17 chs 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.185 2019/12/27 09:41:51 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.186 2020/02/18 20:23:17 chs Exp $"); #include "opt_uvmhist.h" #include "opt_compat_netbsd.h" @@ -1778,10 +1778,6 @@ uvm_swap_io(struct vm_page **pps, int st 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. */ @@ -1836,8 +1832,7 @@ uvm_swap_io(struct vm_page **pps, int st */ if (async) { - KASSERT(uvm.aiodone_queue != NULL); - bp->b_iodone = uvm_aio_biodone; + bp->b_iodone = uvm_aio_aiodone; UVMHIST_LOG(pdhist, "doing async!", 0, 0, 0, 0); if (curlwp == uvm.pagedaemon_lwp) BIO_SETPRIO(bp, BPRIO_TIMECRITICAL);