From owner-svn-src-user@freebsd.org Sun Feb 4 19:14:10 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64A11EEA519 for ; Sun, 4 Feb 2018 19:14:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05B266E066; Sun, 4 Feb 2018 19:14:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF4881E38B; Sun, 4 Feb 2018 19:14:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14JE95Y097656; Sun, 4 Feb 2018 19:14:09 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14JE9u4097652; Sun, 4 Feb 2018 19:14:09 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802041914.w14JE9u4097652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 4 Feb 2018 19:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328860 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2018 19:14:10 -0000 Author: jeff Date: Sun Feb 4 19:14:09 2018 New Revision: 328860 URL: https://svnweb.freebsd.org/changeset/base/328860 Log: Prototype vm pagequeue batches. From Isilon, mlaier & markj Use contig allocations for vm_page_import. Modified: user/jeff/numa/sys/vm/vm_object.c user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_pageout.c user/jeff/numa/sys/vm/vm_pagequeue.h Modified: user/jeff/numa/sys/vm/vm_object.c ============================================================================== --- user/jeff/numa/sys/vm/vm_object.c Sun Feb 4 19:12:03 2018 (r328859) +++ user/jeff/numa/sys/vm/vm_object.c Sun Feb 4 19:14:09 2018 (r328860) @@ -723,7 +723,6 @@ vm_object_terminate_pages(vm_object_t object) vm_page_t p, p_next; struct mtx *mtx, *mtx1; struct vm_pagequeue *pq, *pq1; - int dequeued; VM_OBJECT_ASSERT_WLOCKED(object); @@ -748,7 +747,6 @@ vm_object_terminate_pages(vm_object_t object) if (mtx != NULL) mtx_unlock(mtx); if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); vm_pagequeue_unlock(pq); pq = NULL; } @@ -766,27 +764,19 @@ vm_object_terminate_pages(vm_object_t object) "page %p is not queued", p)); pq1 = vm_page_pagequeue(p); if (pq != pq1) { - if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); + if (pq != NULL) vm_pagequeue_unlock(pq); - } pq = pq1; vm_pagequeue_lock(pq); - dequeued = 0; } - p->queue = PQ_NONE; - TAILQ_REMOVE(&pq->pq_pl, p, plinks.q); - dequeued--; } if (vm_page_free_prep(p, true)) continue; unlist: TAILQ_REMOVE(&object->memq, p, listq); } - if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); + if (pq != NULL) vm_pagequeue_unlock(pq); - } if (mtx != NULL) mtx_unlock(mtx); Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Sun Feb 4 19:12:03 2018 (r328859) +++ user/jeff/numa/sys/vm/vm_page.c Sun Feb 4 19:14:09 2018 (r328860) @@ -74,6 +74,13 @@ * * The page daemon can acquire and hold any pair of page queue * locks in any order. * + * * Batch queues are used to defer insertions of pages into the + * main paging queues. The aim is to reduce contention at the + * entry point of the queue by inserting multiple pages in an + * O(1) operation. This comes at the expense of strict LRU. + * Only a page lock is required to insert a page into a batch + * queue. + * * - The object lock is required when inserting or removing * pages from an object (vm_page_insert() or vm_page_remove()). * @@ -425,7 +432,7 @@ vm_page_domain_init(int domain) { struct vm_domain *vmd; struct vm_pagequeue *pq; - int i; + int i, j; vmd = VM_DOMAIN(domain); bzero(vmd, sizeof(*vmd)); @@ -447,6 +454,15 @@ vm_page_domain_init(int domain) TAILQ_INIT(&pq->pq_pl); mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue", MTX_DEF | MTX_DUPOK); + + /* + * The batch queue limits are set in vm_pageout_init() once + * we've set the paging targets. + */ + for (j = 0; j < BPQ_COUNT; j++) { + TAILQ_INIT(&pq->pq_bpqs[j].bpq_pl); + pq->pq_bpqs[j].bpq_lim = 1; + } } mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); } @@ -2170,9 +2186,10 @@ vm_page_import(void *arg, void **store, int cnt, int d vmd = arg; domain = vmd->vmd_domain; + cnt = rounddown2(cnt, 8); vm_domain_free_lock(vmd); - for (i = 0; i < cnt; i++) { - m = vm_phys_alloc_pages(domain, VM_FREELIST_DEFAULT, 0); + for (i = 0; i < cnt; i+=8) { + m = vm_phys_alloc_pages(domain, VM_FREELIST_DEFAULT, 3); if (m == NULL) break; store[i] = m; @@ -2180,6 +2197,13 @@ vm_page_import(void *arg, void **store, int cnt, int d if (i != 0) vm_domain_freecnt_adj(vmd, -i); vm_domain_free_unlock(vmd); + cnt = i; + for (i = 0; i < cnt; i++) { + if ((i % 8) == 0) + m = store[i]; + else + store[i] = ++m; + } return (i); } @@ -2972,6 +2996,30 @@ vm_page_pagequeue(vm_page_t m) } /* + * vm_page_enqueue_batch: + * + * Concatenate the pages in a batch queue to their corresponding paging + * queue. + * + * The pagequeue must be locked. + */ +static void +vm_page_enqueue_batch(struct vm_pagequeue *pq, u_int idx) +{ + struct vm_batchqueue *bpq; + + KASSERT(idx < BPQ_COUNT, ("invalid batch queue index %u", idx)); + vm_pagequeue_assert_locked(pq); + + bpq = &pq->pq_bpqs[idx]; + if (bpq->bpq_cnt != 0) { + TAILQ_CONCAT(&pq->pq_pl, &bpq->bpq_pl, plinks.q); + vm_pagequeue_cnt_add(pq, bpq->bpq_cnt); + bpq->bpq_cnt = 0; + } +} + +/* * vm_page_dequeue: * * Remove the given page from its current page queue. @@ -2989,6 +3037,7 @@ vm_page_dequeue(vm_page_t m) pq = vm_page_pagequeue(m); vm_pagequeue_lock(pq); m->queue = PQ_NONE; + vm_page_enqueue_batch(pq, BPQ_IDX(m)); TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_pagequeue_cnt_dec(pq); vm_pagequeue_unlock(pq); @@ -3009,6 +3058,7 @@ vm_page_dequeue_locked(vm_page_t m) vm_page_lock_assert(m, MA_OWNED); pq = vm_page_pagequeue(m); vm_pagequeue_assert_locked(pq); + vm_page_enqueue_batch(pq, BPQ_IDX(m)); m->queue = PQ_NONE; TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_pagequeue_cnt_dec(pq); @@ -3024,6 +3074,7 @@ vm_page_dequeue_locked(vm_page_t m) static void vm_page_enqueue(uint8_t queue, vm_page_t m) { + struct vm_batchqueue *bpq; struct vm_pagequeue *pq; vm_page_lock_assert(m, MA_OWNED); @@ -3031,11 +3082,14 @@ vm_page_enqueue(uint8_t queue, vm_page_t m) ("vm_page_enqueue: invalid queue %u request for page %p", queue, m)); pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; - vm_pagequeue_lock(pq); m->queue = queue; - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - vm_pagequeue_cnt_inc(pq); - vm_pagequeue_unlock(pq); + bpq = &pq->pq_bpqs[BPQ_IDX(m)]; + TAILQ_INSERT_TAIL(&bpq->bpq_pl, m, plinks.q); + if (bpq->bpq_cnt++ >= bpq->bpq_lim) { + vm_pagequeue_lock(pq); + vm_page_enqueue_batch(pq, BPQ_IDX(m)); + vm_pagequeue_unlock(pq); + } } /* @@ -3055,6 +3109,7 @@ vm_page_requeue(vm_page_t m) ("vm_page_requeue: page %p is not queued", m)); pq = vm_page_pagequeue(m); vm_pagequeue_lock(pq); + vm_page_enqueue_batch(pq, BPQ_IDX(m)); TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); vm_pagequeue_unlock(pq); @@ -3072,10 +3127,12 @@ vm_page_requeue_locked(vm_page_t m) { struct vm_pagequeue *pq; + vm_page_lock_assert(m, MA_OWNED); KASSERT(m->queue != PQ_NONE, ("vm_page_requeue_locked: page %p is not queued", m)); pq = vm_page_pagequeue(m); vm_pagequeue_assert_locked(pq); + vm_page_enqueue_batch(pq, BPQ_IDX(m)); TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); } @@ -3396,6 +3453,7 @@ vm_page_unwire(vm_page_t m, uint8_t queue) static inline void _vm_page_deactivate(vm_page_t m, boolean_t noreuse) { + struct vm_batchqueue *bpq; struct vm_pagequeue *pq; int queue; @@ -3416,9 +3474,17 @@ _vm_page_deactivate(vm_page_t m, boolean_t noreuse) } else { if (queue != PQ_NONE) vm_page_dequeue(m); + bpq = &pq->pq_bpqs[BPQ_IDX(m)]; + if (bpq->bpq_cnt < bpq->bpq_lim) { + bpq->bpq_cnt++; + m->queue = PQ_INACTIVE; + TAILQ_INSERT_TAIL(&bpq->bpq_pl, m, plinks.q); + return; + } vm_pagequeue_lock(pq); } m->queue = PQ_INACTIVE; + vm_page_enqueue_batch(pq, BPQ_IDX(m)); if (noreuse) TAILQ_INSERT_BEFORE( &vm_pagequeue_domain(m)->vmd_inacthead, m, Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Sun Feb 4 19:12:03 2018 (r328859) +++ user/jeff/numa/sys/vm/vm_pageout.c Sun Feb 4 19:14:09 2018 (r328860) @@ -1922,6 +1922,7 @@ static void vm_pageout_init_domain(int domain) { struct vm_domain *vmd; + int lim, i, j; vmd = VM_DOMAIN(domain); vmd->vmd_interrupt_free_min = 2; @@ -1960,6 +1961,22 @@ vm_pageout_init_domain(int domain) */ vmd->vmd_background_launder_target = (vmd->vmd_free_target - vmd->vmd_free_min) / 10; + + /* + * Set batch queue limits for paging queues. + * + * We want these to be small relative to the amount of system memory. + * Roughly v_page_count / PA_LOCK_COUNT pages are mapped to a given + * batch queue; ensure that no more than 0.1% of them may be queued in + * the batch queue for a particular page queue. Then no more than + * 0.1% * PQ_COUNT can be queued across all page queues. This gives a + * per-page queue batch limit of 1 page per GB of memory on amd64. + */ + + lim = MAX(vmd->vmd_page_count / 1000 / BPQ_COUNT, 8); + for (i = 0; i < PQ_COUNT; i++) + for (j = 0; j < BPQ_COUNT; j++) + vmd->vmd_pagequeues[i].pq_bpqs[j].bpq_lim = lim; } static void Modified: user/jeff/numa/sys/vm/vm_pagequeue.h ============================================================================== --- user/jeff/numa/sys/vm/vm_pagequeue.h Sun Feb 4 19:12:03 2018 (r328859) +++ user/jeff/numa/sys/vm/vm_pagequeue.h Sun Feb 4 19:14:09 2018 (r328860) @@ -66,11 +66,23 @@ #define _VM_PAGEQUEUE_ #ifdef _KERNEL + +#define BPQ_COUNT PA_LOCK_COUNT +#define BPQ_IDX(m) (pa_index(VM_PAGE_TO_PHYS(m)) % BPQ_COUNT) + +struct vm_batchqueue { + struct pglist bpq_pl; + int bpq_cnt; + int bpq_lim; +} __aligned(CACHE_LINE_SIZE); + struct vm_pagequeue { struct mtx pq_mutex; struct pglist pq_pl; int pq_cnt; const char * const pq_name; + char _pq_pad[0] __aligned(CACHE_LINE_SIZE); + struct vm_batchqueue pq_bpqs[BPQ_COUNT]; } __aligned(CACHE_LINE_SIZE); #include From owner-svn-src-user@freebsd.org Mon Feb 5 16:00:34 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448A8ED7618 for ; Mon, 5 Feb 2018 16:00:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECC1979699; Mon, 5 Feb 2018 16:00:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E78472B89; Mon, 5 Feb 2018 16:00:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15G0Xel015465; Mon, 5 Feb 2018 16:00:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15G0UmG015434; Mon, 5 Feb 2018 16:00:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802051600.w15G0UmG015434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Feb 2018 16:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328886 - in user/markj/netdump: . bin/sh contrib/blacklist/libexec contrib/llvm/include/llvm contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/Selecti... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . bin/sh contrib/blacklist/libexec contrib/llvm/include/llvm contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/lib/Ta... X-SVN-Commit-Revision: 328886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 16:00:34 -0000 Author: markj Date: Mon Feb 5 16:00:30 2018 New Revision: 328886 URL: https://svnweb.freebsd.org/changeset/base/328886 Log: MFH at r328885. Added: user/markj/netdump/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp - copied unchanged from r328885, head/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp - copied unchanged from r328885, head/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp user/markj/netdump/sys/powerpc/conf/GENERIC64-NODEBUG - copied unchanged from r328885, head/sys/powerpc/conf/GENERIC64-NODEBUG Deleted: user/markj/netdump/stand/forth/pcibios.4th user/markj/netdump/stand/forth/pnp.4th Modified: user/markj/netdump/ObsoleteFiles.inc user/markj/netdump/bin/sh/jobs.c user/markj/netdump/contrib/blacklist/libexec/blacklistd-helper user/markj/netdump/contrib/llvm/include/llvm/CodeGen/Passes.h user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetLowering.h user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h user/markj/netdump/contrib/llvm/include/llvm/InitializePasses.h user/markj/netdump/contrib/llvm/lib/CodeGen/CodeGen.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp user/markj/netdump/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp user/markj/netdump/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86.h user/markj/netdump/contrib/llvm/lib/Target/X86/X86.td user/markj/netdump/contrib/llvm/lib/Target/X86/X86AsmPrinter.h user/markj/netdump/contrib/llvm/lib/Target/X86/X86FastISel.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.h user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrCompiler.td user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrControl.td user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrInfo.td user/markj/netdump/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86Subtarget.cpp user/markj/netdump/contrib/llvm/lib/Target/X86/X86Subtarget.h user/markj/netdump/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp user/markj/netdump/contrib/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp user/markj/netdump/contrib/llvm/tools/clang/include/clang/Driver/Options.td user/markj/netdump/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp user/markj/netdump/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h user/markj/netdump/contrib/llvm/tools/lld/ELF/Arch/X86.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp user/markj/netdump/contrib/llvm/tools/lld/ELF/Config.h user/markj/netdump/contrib/llvm/tools/lld/ELF/Driver.cpp user/markj/netdump/contrib/llvm/tools/opt/opt.cpp user/markj/netdump/lib/clang/freebsd_cc_version.h user/markj/netdump/lib/clang/include/clang/Basic/Version.inc user/markj/netdump/lib/clang/include/lld/Common/Version.inc user/markj/netdump/lib/clang/include/llvm/Support/VCSRevision.h user/markj/netdump/lib/clang/libllvm/Makefile user/markj/netdump/lib/libc/sparc64/sys/__sparc_utrap_setup.c user/markj/netdump/lib/libc/stdlib/strtold.c user/markj/netdump/lib/libufs/sblock.c user/markj/netdump/libexec/getty/extern.h user/markj/netdump/libexec/getty/init.c user/markj/netdump/libexec/getty/main.c user/markj/netdump/libexec/getty/subr.c user/markj/netdump/libexec/rtld-elf/aarch64/reloc.c user/markj/netdump/libexec/rtld-elf/amd64/reloc.c user/markj/netdump/libexec/rtld-elf/arm/reloc.c user/markj/netdump/libexec/rtld-elf/i386/reloc.c user/markj/netdump/libexec/rtld-elf/mips/reloc.c user/markj/netdump/libexec/rtld-elf/powerpc/reloc.c user/markj/netdump/libexec/rtld-elf/powerpc64/reloc.c user/markj/netdump/libexec/rtld-elf/riscv/reloc.c user/markj/netdump/libexec/rtld-elf/rtld.c user/markj/netdump/libexec/rtld-elf/rtld.h user/markj/netdump/libexec/rtld-elf/sparc64/reloc.c user/markj/netdump/sbin/dhclient/dhclient.c user/markj/netdump/sbin/etherswitchcfg/etherswitchcfg.c user/markj/netdump/sbin/geom/class/cache/geom_cache.c user/markj/netdump/sbin/geom/class/concat/geom_concat.c user/markj/netdump/sbin/geom/class/journal/geom_journal.c user/markj/netdump/sbin/geom/class/label/geom_label.c user/markj/netdump/sbin/geom/class/mirror/geom_mirror.c user/markj/netdump/sbin/geom/class/raid3/geom_raid3.c user/markj/netdump/sbin/geom/class/shsec/geom_shsec.c user/markj/netdump/sbin/geom/class/stripe/geom_stripe.c user/markj/netdump/sbin/geom/misc/subr.c user/markj/netdump/sbin/newfs/mkfs.c user/markj/netdump/share/examples/bhyve/vmrun.sh user/markj/netdump/share/man/man3/pthread_join.3 user/markj/netdump/share/mk/bsd.sys.mk user/markj/netdump/stand/arm/uboot/Makefile user/markj/netdump/stand/common/load_elf.c user/markj/netdump/stand/common/pnp.c user/markj/netdump/stand/efi/fdt/efi_fdt.c user/markj/netdump/stand/efi/libefi/Makefile user/markj/netdump/stand/efi/libefi/env.c user/markj/netdump/stand/efi/loader/Makefile user/markj/netdump/stand/ficl.mk user/markj/netdump/stand/forth/Makefile user/markj/netdump/stand/forth/loader.4th user/markj/netdump/stand/i386/libi386/biospci.c user/markj/netdump/stand/i386/loader/Makefile user/markj/netdump/stand/libsa/stand.h user/markj/netdump/stand/loader.mk user/markj/netdump/stand/mips/beri/loader/Makefile user/markj/netdump/stand/mips/uboot/Makefile user/markj/netdump/stand/ofw/common/main.c user/markj/netdump/stand/ofw/libofw/elf_freebsd.c user/markj/netdump/stand/ofw/libofw/libofw.h user/markj/netdump/stand/ofw/libofw/ofw_copy.c user/markj/netdump/stand/ofw/libofw/ofw_memory.c user/markj/netdump/stand/ofw/libofw/ppc64_elf_freebsd.c user/markj/netdump/stand/powerpc/kboot/Makefile user/markj/netdump/stand/powerpc/ofw/Makefile user/markj/netdump/stand/powerpc/ofw/ldscript.powerpc user/markj/netdump/stand/powerpc/uboot/Makefile user/markj/netdump/stand/sparc64/loader/Makefile user/markj/netdump/stand/userboot/userboot/Makefile user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/markj/netdump/sys/compat/freebsd32/freebsd32_ipc.h user/markj/netdump/sys/conf/files user/markj/netdump/sys/dev/atkbdc/psm.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_7240.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_8316.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_8327.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_9340.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchreg.h user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchvar.h user/markj/netdump/sys/dev/mpr/mpr.c user/markj/netdump/sys/dev/usb/serial/uslcom.c user/markj/netdump/sys/dev/usb/usbdevs user/markj/netdump/sys/fs/ext2fs/ext2_extents.c user/markj/netdump/sys/fs/ext2fs/ext2_vfsops.c user/markj/netdump/sys/fs/ext2fs/ext2fs.h user/markj/netdump/sys/geom/label/g_label_ufs.c user/markj/netdump/sys/geom/virstor/g_virstor.c user/markj/netdump/sys/kern/sysv_msg.c user/markj/netdump/sys/kern/sysv_sem.c user/markj/netdump/sys/kern/sysv_shm.c user/markj/netdump/sys/mips/conf/DB120 user/markj/netdump/sys/mips/conf/DB120.hints user/markj/netdump/sys/mips/conf/std.AR934X user/markj/netdump/sys/modules/linux/Makefile user/markj/netdump/sys/modules/linux64/Makefile user/markj/netdump/sys/netinet6/frag6.c user/markj/netdump/sys/netinet6/ip6_input.c user/markj/netdump/sys/netinet6/ip6_var.h user/markj/netdump/sys/netinet6/raw_ip6.c user/markj/netdump/sys/powerpc/conf/MPC85XX user/markj/netdump/sys/powerpc/conf/MPC85XXSPE user/markj/netdump/sys/powerpc/mpc85xx/mpc85xx_cache.c user/markj/netdump/sys/vm/vm_object.c user/markj/netdump/tools/boot/install-boot.sh user/markj/netdump/tools/boot/rootgen.sh user/markj/netdump/tools/tools/nanobsd/legacy.sh user/markj/netdump/usr.bin/clang/lld/ld.lld.1 user/markj/netdump/usr.sbin/bsdinstall/scripts/auto user/markj/netdump/usr.sbin/makefs/tests/makefs_cd9660_tests.sh user/markj/netdump/usr.sbin/newsyslog/newsyslog.8 Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/contrib/blacklist/ (props changed) user/markj/netdump/contrib/compiler-rt/ (props changed) user/markj/netdump/contrib/libc++/ (props changed) user/markj/netdump/contrib/llvm/ (props changed) user/markj/netdump/contrib/llvm/tools/clang/ (props changed) user/markj/netdump/contrib/llvm/tools/lld/ (props changed) user/markj/netdump/contrib/llvm/tools/lldb/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/ObsoleteFiles.inc ============================================================================== --- user/markj/netdump/ObsoleteFiles.inc Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/ObsoleteFiles.inc Mon Feb 5 16:00:30 2018 (r328886) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180201: Obsolete forth files +OLD_FILES+=boot/efi.4th +OLD_FILES+=boot/pcibios.4th + # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: user/markj/netdump/bin/sh/jobs.c ============================================================================== --- user/markj/netdump/bin/sh/jobs.c Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/bin/sh/jobs.c Mon Feb 5 16:00:30 2018 (r328886) @@ -362,7 +362,7 @@ showjob(struct job *jp, int mode) const char *statestr, *coredump; struct procstat *ps; struct job *j; - int col, curr, i, jobno, prev, procno; + int col, curr, i, jobno, prev, procno, status; char c; procno = (mode == SHOWJOBS_PGIDS) ? 1 : jp->nprocs; @@ -376,11 +376,12 @@ showjob(struct job *jp, int mode) } #endif coredump = ""; - ps = jp->ps + jp->nprocs - 1; + status = jp->ps[jp->nprocs - 1].status; if (jp->state == 0) { statestr = "Running"; #if JOBS } else if (jp->state == JOBSTOPPED) { + ps = jp->ps + jp->nprocs - 1; while (!WIFSTOPPED(ps->status) && ps > jp->ps) ps--; if (WIFSTOPPED(ps->status)) @@ -391,20 +392,20 @@ showjob(struct job *jp, int mode) if (statestr == NULL) statestr = "Suspended"; #endif - } else if (WIFEXITED(ps->status)) { - if (WEXITSTATUS(ps->status) == 0) + } else if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) statestr = "Done"; else { fmtstr(statebuf, sizeof(statebuf), "Done(%d)", - WEXITSTATUS(ps->status)); + WEXITSTATUS(status)); statestr = statebuf; } } else { - i = WTERMSIG(ps->status); + i = WTERMSIG(status); statestr = strsignal(i); if (statestr == NULL) statestr = "Unknown signal"; - if (WCOREDUMP(ps->status)) + if (WCOREDUMP(status)) coredump = " (core dumped)"; } Modified: user/markj/netdump/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- user/markj/netdump/contrib/blacklist/libexec/blacklistd-helper Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/blacklist/libexec/blacklistd-helper Mon Feb 5 16:00:30 2018 (r328886) @@ -80,8 +80,8 @@ add) echo "block in quick $proto from to any $port" | \ /sbin/pfctl -a "$2/$6" -f - # insert $ip/$mask into per-protocol/port anchored table - /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \ - echo OK + /sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \ + /sbin/pfctl -q -k $addr && echo OK ;; esac ;; @@ -101,7 +101,7 @@ rem) /sbin/npfctl rule "$2" rem-id "$7" ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ + /sbin/pfctl -qa "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ echo OK ;; esac @@ -118,7 +118,13 @@ flush) /sbin/npfctl rule "$2" flush ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK + # dynamically determine which anchors exist + anchors=$(/sbin/pfctl -a $2 -s Anchors) + for anchor in $anchors; do + /sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush + /sbin/pfctl -a $anchor -F rules + done + echo OK ;; esac ;; Modified: user/markj/netdump/contrib/llvm/include/llvm/CodeGen/Passes.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/CodeGen/Passes.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/CodeGen/Passes.h Mon Feb 5 16:00:30 2018 (r328886) @@ -417,6 +417,9 @@ namespace llvm { // This pass expands memcmp() to load/stores. FunctionPass *createExpandMemCmpPass(); + // This pass expands indirectbr instructions. + FunctionPass *createIndirectBrExpandPass(); + } // End llvm namespace #endif Modified: user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h Mon Feb 5 16:00:30 2018 (r328886) @@ -950,6 +950,10 @@ class TargetInstrInfo : public MCInstrInfo { (public) /// Return true when a target supports MachineCombiner. virtual bool useMachineCombiner() const { return false; } + /// Return true if the given SDNode can be copied during scheduling + /// even if it has glue. + virtual bool canCopyGluedNodeDuringSchedule(SDNode *N) const { return false; } + protected: /// Target-dependent implementation for foldMemoryOperand. /// Target-independent code in foldMemoryOperand will Modified: user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetLowering.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetLowering.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetLowering.h Mon Feb 5 16:00:30 2018 (r328886) @@ -800,7 +800,7 @@ class TargetLoweringBase { (public) } /// Return true if lowering to a jump table is allowed. - bool areJTsAllowed(const Function *Fn) const { + virtual bool areJTsAllowed(const Function *Fn) const { if (Fn->getFnAttribute("no-jump-tables").getValueAsString() == "true") return false; Modified: user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h Mon Feb 5 16:00:30 2018 (r328886) @@ -416,6 +416,13 @@ class TargetPassConfig : public ImmutablePass { (prote /// immediately before machine code is emitted. virtual void addPreEmitPass() { } + /// Targets may add passes immediately before machine code is emitted in this + /// callback. This is called even later than `addPreEmitPass`. + // FIXME: Rename `addPreEmitPass` to something more sensible given its actual + // position and remove the `2` suffix here as this callback is what + // `addPreEmitPass` *should* be but in reality isn't. + virtual void addPreEmitPass2() {} + /// Utilities for targets to add passes to the pass manager. /// Modified: user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h Mon Feb 5 16:00:30 2018 (r328886) @@ -174,6 +174,9 @@ class TargetSubtargetInfo : public MCSubtargetInfo { ( /// \brief True if the subtarget should run the atomic expansion pass. virtual bool enableAtomicExpand() const; + /// True if the subtarget should run the indirectbr expansion pass. + virtual bool enableIndirectBrExpand() const; + /// \brief Override generic scheduling policy within a region. /// /// This is a convenient way for targets that don't provide any custom Modified: user/markj/netdump/contrib/llvm/include/llvm/InitializePasses.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/InitializePasses.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/include/llvm/InitializePasses.h Mon Feb 5 16:00:30 2018 (r328886) @@ -161,6 +161,7 @@ void initializeIVUsersWrapperPassPass(PassRegistry&); void initializeIfConverterPass(PassRegistry&); void initializeImplicitNullChecksPass(PassRegistry&); void initializeIndVarSimplifyLegacyPassPass(PassRegistry&); +void initializeIndirectBrExpandPassPass(PassRegistry&); void initializeInductiveRangeCheckEliminationPass(PassRegistry&); void initializeInferAddressSpacesPass(PassRegistry&); void initializeInferFunctionAttrsLegacyPassPass(PassRegistry&); Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/CodeGen.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/CodeGen.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/CodeGen.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -38,6 +38,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) { initializeGCModuleInfoPass(Registry); initializeIfConverterPass(Registry); initializeImplicitNullChecksPass(Registry); + initializeIndirectBrExpandPassPass(Registry); initializeInterleavedAccessPass(Registry); initializeLiveDebugValuesPass(Registry); initializeLiveDebugVariablesPass(Registry); Copied: user/markj/netdump/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp (from r328885, head/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp Mon Feb 5 16:00:30 2018 (r328886, copy of r328885, head/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp) @@ -0,0 +1,221 @@ +//===- IndirectBrExpandPass.cpp - Expand indirectbr to switch -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// +/// Implements an expansion pass to turn `indirectbr` instructions in the IR +/// into `switch` instructions. This works by enumerating the basic blocks in +/// a dense range of integers, replacing each `blockaddr` constant with the +/// corresponding integer constant, and then building a switch that maps from +/// the integers to the actual blocks. All of the indirectbr instructions in the +/// function are redirected to this common switch. +/// +/// While this is generically useful if a target is unable to codegen +/// `indirectbr` natively, it is primarily useful when there is some desire to +/// get the builtin non-jump-table lowering of a switch even when the input +/// source contained an explicit indirect branch construct. +/// +/// Note that it doesn't make any sense to enable this pass unless a target also +/// disables jump-table lowering of switches. Doing that is likely to pessimize +/// the code. +/// +//===----------------------------------------------------------------------===// + +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/Sequence.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/CodeGen/TargetPassConfig.h" +#include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/IRBuilder.h" +#include "llvm/IR/InstIterator.h" +#include "llvm/IR/Instruction.h" +#include "llvm/IR/Instructions.h" +#include "llvm/Pass.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Target/TargetMachine.h" + +using namespace llvm; + +#define DEBUG_TYPE "indirectbr-expand" + +namespace { + +class IndirectBrExpandPass : public FunctionPass { + const TargetLowering *TLI = nullptr; + +public: + static char ID; // Pass identification, replacement for typeid + + IndirectBrExpandPass() : FunctionPass(ID) { + initializeIndirectBrExpandPassPass(*PassRegistry::getPassRegistry()); + } + + bool runOnFunction(Function &F) override; +}; + +} // end anonymous namespace + +char IndirectBrExpandPass::ID = 0; + +INITIALIZE_PASS(IndirectBrExpandPass, DEBUG_TYPE, + "Expand indirectbr instructions", false, false) + +FunctionPass *llvm::createIndirectBrExpandPass() { + return new IndirectBrExpandPass(); +} + +bool IndirectBrExpandPass::runOnFunction(Function &F) { + auto &DL = F.getParent()->getDataLayout(); + auto *TPC = getAnalysisIfAvailable(); + if (!TPC) + return false; + + auto &TM = TPC->getTM(); + auto &STI = *TM.getSubtargetImpl(F); + if (!STI.enableIndirectBrExpand()) + return false; + TLI = STI.getTargetLowering(); + + SmallVector IndirectBrs; + + // Set of all potential successors for indirectbr instructions. + SmallPtrSet IndirectBrSuccs; + + // Build a list of indirectbrs that we want to rewrite. + for (BasicBlock &BB : F) + if (auto *IBr = dyn_cast(BB.getTerminator())) { + // Handle the degenerate case of no successors by replacing the indirectbr + // with unreachable as there is no successor available. + if (IBr->getNumSuccessors() == 0) { + (void)new UnreachableInst(F.getContext(), IBr); + IBr->eraseFromParent(); + continue; + } + + IndirectBrs.push_back(IBr); + for (BasicBlock *SuccBB : IBr->successors()) + IndirectBrSuccs.insert(SuccBB); + } + + if (IndirectBrs.empty()) + return false; + + // If we need to replace any indirectbrs we need to establish integer + // constants that will correspond to each of the basic blocks in the function + // whose address escapes. We do that here and rewrite all the blockaddress + // constants to just be those integer constants cast to a pointer type. + SmallVector BBs; + + for (BasicBlock &BB : F) { + // Skip blocks that aren't successors to an indirectbr we're going to + // rewrite. + if (!IndirectBrSuccs.count(&BB)) + continue; + + auto IsBlockAddressUse = [&](const Use &U) { + return isa(U.getUser()); + }; + auto BlockAddressUseIt = llvm::find_if(BB.uses(), IsBlockAddressUse); + if (BlockAddressUseIt == BB.use_end()) + continue; + + assert(std::find_if(std::next(BlockAddressUseIt), BB.use_end(), + IsBlockAddressUse) == BB.use_end() && + "There should only ever be a single blockaddress use because it is " + "a constant and should be uniqued."); + + auto *BA = cast(BlockAddressUseIt->getUser()); + + // Skip if the constant was formed but ended up not being used (due to DCE + // or whatever). + if (!BA->isConstantUsed()) + continue; + + // Compute the index we want to use for this basic block. We can't use zero + // because null can be compared with block addresses. + int BBIndex = BBs.size() + 1; + BBs.push_back(&BB); + + auto *ITy = cast(DL.getIntPtrType(BA->getType())); + ConstantInt *BBIndexC = ConstantInt::get(ITy, BBIndex); + + // Now rewrite the blockaddress to an integer constant based on the index. + // FIXME: We could potentially preserve the uses as arguments to inline asm. + // This would allow some uses such as diagnostic information in crashes to + // have higher quality even when this transform is enabled, but would break + // users that round-trip blockaddresses through inline assembly and then + // back into an indirectbr. + BA->replaceAllUsesWith(ConstantExpr::getIntToPtr(BBIndexC, BA->getType())); + } + + if (BBs.empty()) { + // There are no blocks whose address is taken, so any indirectbr instruction + // cannot get a valid input and we can replace all of them with unreachable. + for (auto *IBr : IndirectBrs) { + (void)new UnreachableInst(F.getContext(), IBr); + IBr->eraseFromParent(); + } + return true; + } + + BasicBlock *SwitchBB; + Value *SwitchValue; + + // Compute a common integer type across all the indirectbr instructions. + IntegerType *CommonITy = nullptr; + for (auto *IBr : IndirectBrs) { + auto *ITy = + cast(DL.getIntPtrType(IBr->getAddress()->getType())); + if (!CommonITy || ITy->getBitWidth() > CommonITy->getBitWidth()) + CommonITy = ITy; + } + + auto GetSwitchValue = [DL, CommonITy](IndirectBrInst *IBr) { + return CastInst::CreatePointerCast( + IBr->getAddress(), CommonITy, + Twine(IBr->getAddress()->getName()) + ".switch_cast", IBr); + }; + + if (IndirectBrs.size() == 1) { + // If we only have one indirectbr, we can just directly replace it within + // its block. + SwitchBB = IndirectBrs[0]->getParent(); + SwitchValue = GetSwitchValue(IndirectBrs[0]); + IndirectBrs[0]->eraseFromParent(); + } else { + // Otherwise we need to create a new block to hold the switch across BBs, + // jump to that block instead of each indirectbr, and phi together the + // values for the switch. + SwitchBB = BasicBlock::Create(F.getContext(), "switch_bb", &F); + auto *SwitchPN = PHINode::Create(CommonITy, IndirectBrs.size(), + "switch_value_phi", SwitchBB); + SwitchValue = SwitchPN; + + // Now replace the indirectbr instructions with direct branches to the + // switch block and fill out the PHI operands. + for (auto *IBr : IndirectBrs) { + SwitchPN->addIncoming(GetSwitchValue(IBr), IBr->getParent()); + BranchInst::Create(SwitchBB, IBr); + IBr->eraseFromParent(); + } + } + + // Now build the switch in the block. The block will have no terminator + // already. + auto *SI = SwitchInst::Create(SwitchValue, BBs[0], BBs.size(), SwitchBB); + + // Add a case for each block. + for (int i : llvm::seq(1, BBs.size())) + SI->addCase(ConstantInt::get(CommonITy, i + 1), BBs[i]); + + return true; +} Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -1996,14 +1996,15 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Lib Type *ArgTy = ArgVT.getTypeForEVT(*DAG.getContext()); Entry.Node = Op; Entry.Ty = ArgTy; - Entry.IsSExt = isSigned; - Entry.IsZExt = !isSigned; + Entry.IsSExt = TLI.shouldSignExtendTypeInLibCall(ArgVT, isSigned); + Entry.IsZExt = !TLI.shouldSignExtendTypeInLibCall(ArgVT, isSigned); Args.push_back(Entry); } SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC), TLI.getPointerTy(DAG.getDataLayout())); - Type *RetTy = Node->getValueType(0).getTypeForEVT(*DAG.getContext()); + EVT RetVT = Node->getValueType(0); + Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext()); // By default, the input chain to this libcall is the entry node of the // function. If the libcall is going to be emitted as a tail call then @@ -2022,13 +2023,14 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Lib InChain = TCChain; TargetLowering::CallLoweringInfo CLI(DAG); + bool signExtend = TLI.shouldSignExtendTypeInLibCall(RetVT, isSigned); CLI.setDebugLoc(SDLoc(Node)) .setChain(InChain) .setLibCallee(TLI.getLibcallCallingConv(LC), RetTy, Callee, std::move(Args)) .setTailCall(isTailCall) - .setSExtResult(isSigned) - .setZExtResult(!isSigned) + .setSExtResult(signExtend) + .setZExtResult(!signExtend) .setIsPostTypeLegalization(true); std::pair CallInfo = TLI.LowerCallTo(CLI); Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -1117,22 +1117,34 @@ SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit if (!N) return nullptr; - if (SU->getNode()->getGluedNode()) + DEBUG(dbgs() << "Considering duplicating the SU\n"); + DEBUG(SU->dump(this)); + + if (N->getGluedNode() && + !TII->canCopyGluedNodeDuringSchedule(N)) { + DEBUG(dbgs() + << "Giving up because it has incoming glue and the target does not " + "want to copy it\n"); return nullptr; + } SUnit *NewSU; bool TryUnfold = false; for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) { MVT VT = N->getSimpleValueType(i); - if (VT == MVT::Glue) + if (VT == MVT::Glue) { + DEBUG(dbgs() << "Giving up because it has outgoing glue\n"); return nullptr; - else if (VT == MVT::Other) + } else if (VT == MVT::Other) TryUnfold = true; } for (const SDValue &Op : N->op_values()) { MVT VT = Op.getNode()->getSimpleValueType(Op.getResNo()); - if (VT == MVT::Glue) + if (VT == MVT::Glue && !TII->canCopyGluedNodeDuringSchedule(N)) { + DEBUG(dbgs() << "Giving up because it one of the operands is glue and " + "the target does not want to copy it\n"); return nullptr; + } } // If possible unfold instruction. Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -907,6 +907,9 @@ void TargetPassConfig::addMachinePasses() { if (EnableMachineOutliner) PM->add(createMachineOutlinerPass(EnableLinkOnceODROutlining)); + // Add passes that directly emit MI after all other MI passes. + addPreEmitPass2(); + AddingMachinePasses = false; } Modified: user/markj/netdump/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -38,6 +38,10 @@ bool TargetSubtargetInfo::enableAtomicExpand() const { return true; } +bool TargetSubtargetInfo::enableIndirectBrExpand() const { + return false; +} + bool TargetSubtargetInfo::enableMachineScheduler() const { return false; } Modified: user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -3756,36 +3756,45 @@ void SIInstrInfo::moveToVALU(MachineInstr &TopInst) co // FIXME: This isn't safe because the addressing mode doesn't work // correctly if vaddr is negative. // - // FIXME: Handle v_add_u32 and VOP3 form. Also don't rely on immediate - // being in src0. - // // FIXME: Should probably be done somewhere else, maybe SIFoldOperands. // // See if we can extract an immediate offset by recognizing one of these: // V_ADD_I32_e32 dst, imm, src1 // V_ADD_I32_e32 dst, (S_MOV_B32 imm), src1 // V_ADD will be removed by "Remove dead machine instructions". - if (Add && Add->getOpcode() == AMDGPU::V_ADD_I32_e32) { - const MachineOperand *Src = - getNamedOperand(*Add, AMDGPU::OpName::src0); + if (Add && + (Add->getOpcode() == AMDGPU::V_ADD_I32_e32 || + Add->getOpcode() == AMDGPU::V_ADD_U32_e64)) { + static const unsigned SrcNames[2] = { + AMDGPU::OpName::src0, + AMDGPU::OpName::src1, + }; - if (Src->isReg()) { - auto Mov = MRI.getUniqueVRegDef(Src->getReg()); - if (Mov && Mov->getOpcode() == AMDGPU::S_MOV_B32) - Src = &Mov->getOperand(1); - } + // Find a literal offset in one of source operands. + for (int i = 0; i < 2; i++) { + const MachineOperand *Src = + getNamedOperand(*Add, SrcNames[i]); - if (Src) { - if (Src->isImm()) - Offset = Src->getImm(); - else if (Src->isCImm()) - Offset = Src->getCImm()->getZExtValue(); - } + if (Src->isReg()) { + auto Mov = MRI.getUniqueVRegDef(Src->getReg()); + if (Mov && Mov->getOpcode() == AMDGPU::S_MOV_B32) + Src = &Mov->getOperand(1); + } - if (Offset && isLegalMUBUFImmOffset(Offset)) - VAddr = getNamedOperand(*Add, AMDGPU::OpName::src1); - else + if (Src) { + if (Src->isImm()) + Offset = Src->getImm(); + else if (Src->isCImm()) + Offset = Src->getCImm()->getZExtValue(); + } + + if (Offset && isLegalMUBUFImmOffset(Offset)) { + VAddr = getNamedOperand(*Add, SrcNames[!i]); + break; + } + Offset = 0; + } } BuildMI(*MBB, Inst, Inst.getDebugLoc(), Modified: user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -141,3 +141,16 @@ void Thumb1InstrInfo::expandLoadStackGuard( else expandLoadStackGuardBase(MI, ARM::tLDRLIT_ga_abs, ARM::tLDRi); } + +bool Thumb1InstrInfo::canCopyGluedNodeDuringSchedule(SDNode *N) const { + // In Thumb1 the scheduler may need to schedule a cross-copy between GPRS and CPSR + // but this is not always possible there, so allow the Scheduler to clone tADCS and tSBCS + // even if they have glue. + // FIXME. Actually implement the cross-copy where it is possible (post v6) + // because these copies entail more spilling. + unsigned Opcode = N->getMachineOpcode(); + if (Opcode == ARM::tADCS || Opcode == ARM::tSBCS) + return true; + + return false; +} Modified: user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h Mon Feb 5 16:00:30 2018 (r328886) @@ -53,6 +53,7 @@ class Thumb1InstrInfo : public ARMBaseInstrInfo { (pub const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override; + bool canCopyGluedNodeDuringSchedule(SDNode *N) const override; private: void expandLoadStackGuard(MachineBasicBlock::iterator MI) const override; }; Modified: user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -3507,10 +3507,9 @@ MipsTargetLowering::CanLowerReturn(CallingConv::ID Cal bool MipsTargetLowering::shouldSignExtendTypeInLibCall(EVT Type, bool IsSigned) const { - if (Subtarget.hasMips3() && Subtarget.useSoftFloat()) { - if (Type == MVT::i32) + if ((ABI.IsN32() || ABI.IsN64()) && Type == MVT::i32) return true; - } + return IsSigned; } Modified: user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -136,6 +136,13 @@ IsGlobalInSmallSectionImpl(const GlobalObject *GO, return false; Type *Ty = GVA->getValueType(); + + // It is possible that the type of the global is unsized, i.e. a declaration + // of a extern struct. In this case don't presume it is in the small data + // section. This happens e.g. when building the FreeBSD kernel. + if (!Ty->isSized()) + return false; + return IsInSmallSection( GVA->getParent()->getDataLayout().getTypeAllocSize(Ty)); } Modified: user/markj/netdump/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -88,10 +88,11 @@ void SparcFrameLowering::emitPrologue(MachineFunction assert(&MF.front() == &MBB && "Shrink-wrapping not yet supported"); MachineFrameInfo &MFI = MF.getFrameInfo(); + const SparcSubtarget &Subtarget = MF.getSubtarget(); const SparcInstrInfo &TII = - *static_cast(MF.getSubtarget().getInstrInfo()); + *static_cast(Subtarget.getInstrInfo()); const SparcRegisterInfo &RegInfo = - *static_cast(MF.getSubtarget().getRegisterInfo()); + *static_cast(Subtarget.getRegisterInfo()); MachineBasicBlock::iterator MBBI = MBB.begin(); // Debug location must be unknown since the first debug location is used // to determine the end of the prologue. @@ -141,7 +142,7 @@ void SparcFrameLowering::emitPrologue(MachineFunction // Adds the SPARC subtarget-specific spill area to the stack // size. Also ensures target-required alignment. - NumBytes = MF.getSubtarget().getAdjustedFrameSize(NumBytes); + NumBytes = Subtarget.getAdjustedFrameSize(NumBytes); // Finally, ensure that the size is sufficiently aligned for the // data on the stack. @@ -176,9 +177,27 @@ void SparcFrameLowering::emitPrologue(MachineFunction .addCFIIndex(CFIIndex); if (NeedsStackRealignment) { - // andn %o6, MaxAlign-1, %o6 + int64_t Bias = Subtarget.getStackPointerBias(); + unsigned regUnbiased; + if (Bias) { + // This clobbers G1 which we always know is available here. + regUnbiased = SP::G1; + // add %o6, BIAS, %g1 + BuildMI(MBB, MBBI, dl, TII.get(SP::ADDri), regUnbiased) + .addReg(SP::O6).addImm(Bias); + } else + regUnbiased = SP::O6; + + // andn %regUnbiased, MaxAlign-1, %regUnbiased int MaxAlign = MFI.getMaxAlignment(); - BuildMI(MBB, MBBI, dl, TII.get(SP::ANDNri), SP::O6).addReg(SP::O6).addImm(MaxAlign - 1); + BuildMI(MBB, MBBI, dl, TII.get(SP::ANDNri), regUnbiased) + .addReg(regUnbiased).addImm(MaxAlign - 1); + + if (Bias) { + // add %g1, -BIAS, %o6 + BuildMI(MBB, MBBI, dl, TII.get(SP::ADDri), SP::O6) + .addReg(regUnbiased).addImm(-Bias); + } } } Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86.h ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86.h Mon Feb 5 16:00:30 2018 (r328886) @@ -22,6 +22,7 @@ namespace llvm { class FunctionPass; class ImmutablePass; class InstructionSelector; +class ModulePass; class PassRegistry; class X86RegisterBankInfo; class X86Subtarget; @@ -101,6 +102,9 @@ void initializeFixupBWInstPassPass(PassRegistry &); /// This pass replaces EVEX encoded of AVX-512 instructiosn by VEX /// encoding when possible in order to reduce code size. FunctionPass *createX86EvexToVexInsts(); + +/// This pass creates the thunks for the retpoline feature. +FunctionPass *createX86RetpolineThunksPass(); InstructionSelector *createX86InstructionSelector(const X86TargetMachine &TM, X86Subtarget &, Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86.td Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86.td Mon Feb 5 16:00:30 2018 (r328886) @@ -329,6 +329,27 @@ def FeatureHasFastGather : SubtargetFeature<"fast-gather", "HasFastGather", "true", "Indicates if gather is reasonably fast.">; +// Enable mitigation of some aspects of speculative execution related +// vulnerabilities by removing speculatable indirect branches. This disables +// jump-table formation, rewrites explicit `indirectbr` instructions into +// `switch` instructions, and uses a special construct called a "retpoline" to +// prevent speculation of the remaining indirect branches (indirect calls and +// tail calls). +def FeatureRetpoline + : SubtargetFeature<"retpoline", "UseRetpoline", "true", + "Remove speculation of indirect branches from the " + "generated code, either by avoiding them entirely or " + "lowering them with a speculation blocking construct.">; + +// Rely on external thunks for the emitted retpoline calls. This allows users +// to provide their own custom thunk definitions in highly specialized +// environments such as a kernel that does boot-time hot patching. +def FeatureRetpolineExternalThunk + : SubtargetFeature< + "retpoline-external-thunk", "UseRetpolineExternalThunk", "true", + "Enable retpoline, but with an externally provided thunk.", + [FeatureRetpoline]>; + //===----------------------------------------------------------------------===// // Register File Description //===----------------------------------------------------------------------===// Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86AsmPrinter.h ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86AsmPrinter.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86AsmPrinter.h Mon Feb 5 16:00:30 2018 (r328886) @@ -32,6 +32,7 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public A FaultMaps FM; std::unique_ptr CodeEmitter; bool EmitFPOData = false; + bool NeedsRetpoline = false; // This utility class tracks the length of a stackmap instruction's 'shadow'. // It is used by the X86AsmPrinter to ensure that the stackmap shadow Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86FastISel.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86FastISel.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86FastISel.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -3172,6 +3172,10 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) (CalledFn && CalledFn->hasFnAttribute("no_caller_saved_registers"))) return false; + // Functions using retpoline should use SDISel for calls. + if (Subtarget->useRetpoline()) + return false; + // Handle only C, fastcc, and webkit_js calling conventions for now. switch (CC) { default: return false; Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -741,6 +741,11 @@ void X86FrameLowering::emitStackProbeCall(MachineFunct bool InProlog) const { bool IsLargeCodeModel = MF.getTarget().getCodeModel() == CodeModel::Large; + // FIXME: Add retpoline support and remove this. + if (Is64Bit && IsLargeCodeModel && STI.useRetpoline()) + report_fatal_error("Emitting stack probe calls on 64-bit with the large " + "code model and retpoline not yet implemented."); + unsigned CallOp; if (Is64Bit) CallOp = IsLargeCodeModel ? X86::CALL64r : X86::CALL64pcrel32; @@ -2345,6 +2350,10 @@ void X86FrameLowering::adjustForSegmentedStacks( // This solution is not perfect, as it assumes that the .rodata section // is laid out within 2^31 bytes of each function body, but this seems // to be sufficient for JIT. + // FIXME: Add retpoline support and remove the error here.. + if (STI.useRetpoline()) + report_fatal_error("Emitting morestack calls on 64-bit with the large " + "code model and retpoline not yet implemented."); BuildMI(allocMBB, DL, TII.get(X86::CALL64m)) .addReg(X86::RIP) .addImm(0) Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -629,11 +629,11 @@ void X86DAGToDAGISel::PreprocessISelDAG() { SDNode *N = &*I++; // Preincrement iterator to avoid invalidation issues. if (OptLevel != CodeGenOpt::None && - // Only does this when target favors doesn't favor register indirect - // call. + // Only do this when the target can fold the load into the call or + // jmp. + !Subtarget->useRetpoline() && ((N->getOpcode() == X86ISD::CALL && !Subtarget->slowTwoMemOps()) || (N->getOpcode() == X86ISD::TC_RETURN && - // Only does this if load can be folded into TC_RETURN. (Subtarget->is64Bit() || !getTargetMachine().isPositionIndependent())))) { /// Also try moving call address load from outside callseq_start to just Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Mon Feb 5 16:00:30 2018 (r328886) @@ -25767,6 +25767,15 @@ X86TargetLowering::isVectorClearMaskLegal(const SmallV return isShuffleMaskLegal(Mask, VT); } +bool X86TargetLowering::areJTsAllowed(const Function *Fn) const { + // If the subtarget is using retpolines, we need to not generate jump tables. + if (Subtarget.useRetpoline()) + return false; + + // Otherwise, fallback on the generic logic. + return TargetLowering::areJTsAllowed(Fn); +} + //===----------------------------------------------------------------------===// // X86 Scheduler Hooks //===----------------------------------------------------------------------===// @@ -27069,7 +27078,116 @@ X86TargetLowering::EmitLoweredTLSCall(MachineInstr &MI return BB; } +static unsigned getOpcodeForRetpoline(unsigned RPOpc) { + switch (RPOpc) { + case X86::RETPOLINE_CALL32: + return X86::CALLpcrel32; + case X86::RETPOLINE_CALL64: + return X86::CALL64pcrel32; + case X86::RETPOLINE_TCRETURN32: + return X86::TCRETURNdi; + case X86::RETPOLINE_TCRETURN64: + return X86::TCRETURNdi64; + } + llvm_unreachable("not retpoline opcode"); +} + +static const char *getRetpolineSymbol(const X86Subtarget &Subtarget, + unsigned Reg) { + switch (Reg) { + case 0: + assert(!Subtarget.is64Bit() && "R11 should always be available on x64"); + return Subtarget.useRetpolineExternalThunk() + ? "__llvm_external_retpoline_push" + : "__llvm_retpoline_push"; + case X86::EAX: + return Subtarget.useRetpolineExternalThunk() + ? "__llvm_external_retpoline_eax" + : "__llvm_retpoline_eax"; + case X86::ECX: + return Subtarget.useRetpolineExternalThunk() + ? "__llvm_external_retpoline_ecx" + : "__llvm_retpoline_ecx"; + case X86::EDX: + return Subtarget.useRetpolineExternalThunk() + ? "__llvm_external_retpoline_edx" + : "__llvm_retpoline_edx"; + case X86::R11: + return Subtarget.useRetpolineExternalThunk() + ? "__llvm_external_retpoline_r11" + : "__llvm_retpoline_r11"; + } + llvm_unreachable("unexpected reg for retpoline"); +} + MachineBasicBlock * +X86TargetLowering::EmitLoweredRetpoline(MachineInstr &MI, + MachineBasicBlock *BB) const { + // Copy the virtual register into the R11 physical register and + // call the retpoline thunk. + DebugLoc DL = MI.getDebugLoc(); + const X86InstrInfo *TII = Subtarget.getInstrInfo(); + unsigned CalleeVReg = MI.getOperand(0).getReg(); + unsigned Opc = getOpcodeForRetpoline(MI.getOpcode()); + + // Find an available scratch register to hold the callee. On 64-bit, we can + // just use R11, but we scan for uses anyway to ensure we don't generate + // incorrect code. On 32-bit, we use one of EAX, ECX, or EDX that isn't + // already a register use operand to the call to hold the callee. If none + // are available, push the callee instead. This is less efficient, but is + // necessary for functions using 3 regparms. Such function calls are + // (currently) not eligible for tail call optimization, because there is no + // scratch register available to hold the address of the callee. + SmallVector AvailableRegs; + if (Subtarget.is64Bit()) + AvailableRegs.push_back(X86::R11); + else + AvailableRegs.append({X86::EAX, X86::ECX, X86::EDX}); + + // Zero out any registers that are already used. + for (const auto &MO : MI.operands()) { + if (MO.isReg() && MO.isUse()) + for (unsigned &Reg : AvailableRegs) + if (Reg == MO.getReg()) + Reg = 0; + } + + // Choose the first remaining non-zero available register. + unsigned AvailableReg = 0; + for (unsigned MaybeReg : AvailableRegs) { + if (MaybeReg) { + AvailableReg = MaybeReg; + break; + } + } + + const char *Symbol = getRetpolineSymbol(Subtarget, AvailableReg); + + if (AvailableReg == 0) { + // No register available. Use PUSH. This must not be a tailcall, and this + // must not be x64. + if (Subtarget.is64Bit()) + report_fatal_error( + "Cannot make an indirect call on x86-64 using both retpoline and a " + "calling convention that preservers r11"); + if (Opc != X86::CALLpcrel32) + report_fatal_error("Cannot make an indirect tail call on x86 using " + "retpoline without a preserved register"); + BuildMI(*BB, MI, DL, TII->get(X86::PUSH32r)).addReg(CalleeVReg); + MI.getOperand(0).ChangeToES(Symbol); + MI.setDesc(TII->get(Opc)); + } else { + BuildMI(*BB, MI, DL, TII->get(TargetOpcode::COPY), AvailableReg) + .addReg(CalleeVReg); + MI.getOperand(0).ChangeToES(Symbol); + MI.setDesc(TII->get(Opc)); + MachineInstrBuilder(*BB->getParent(), &MI) + .addReg(AvailableReg, RegState::Implicit | RegState::Kill); + } + return BB; +} + +MachineBasicBlock * X86TargetLowering::emitEHSjLjSetJmp(MachineInstr &MI, MachineBasicBlock *MBB) const { DebugLoc DL = MI.getDebugLoc(); @@ -27584,6 +27702,11 @@ X86TargetLowering::EmitInstrWithCustomInserter(Machine case X86::TLS_base_addr32: case X86::TLS_base_addr64: return EmitLoweredTLSAddr(MI, BB); + case X86::RETPOLINE_CALL32: + case X86::RETPOLINE_CALL64: + case X86::RETPOLINE_TCRETURN32: + case X86::RETPOLINE_TCRETURN64: + return EmitLoweredRetpoline(MI, BB); case X86::CATCHRET: return EmitLoweredCatchRet(MI, BB); case X86::CATCHPAD: Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.h ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.h Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86ISelLowering.h Mon Feb 5 16:00:30 2018 (r328886) @@ -982,6 +982,9 @@ namespace llvm { bool isVectorClearMaskLegal(const SmallVectorImpl &Mask, EVT VT) const override; + /// Returns true if lowering to a jump table is allowed. + bool areJTsAllowed(const Function *Fn) const override; + /// If true, then instruction selection should /// seek to shrink the FP constant of the specified type to a smaller type /// in order to save space and / or reduce runtime. @@ -1293,6 +1296,9 @@ namespace llvm { MachineBasicBlock *EmitLoweredTLSCall(MachineInstr &MI, MachineBasicBlock *BB) const; + + MachineBasicBlock *EmitLoweredRetpoline(MachineInstr &MI, + MachineBasicBlock *BB) const; MachineBasicBlock *emitEHSjLjSetJmp(MachineInstr &MI, MachineBasicBlock *MBB) const; Modified: user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Mon Feb 5 15:14:01 2018 (r328885) +++ user/markj/netdump/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Mon Feb 5 16:00:30 2018 (r328886) @@ -1146,14 +1146,14 @@ def X86tcret_6regs : PatFrag<(ops node:$ptr, node:$off def : Pat<(X86tcret ptr_rc_tailcall:$dst, imm:$off), (TCRETURNri ptr_rc_tailcall:$dst, imm:$off)>, - Requires<[Not64BitMode]>; + Requires<[Not64BitMode, NotUseRetpoline]>; // FIXME: This is disabled for 32-bit PIC mode because the global base // register which is part of the address mode may be assigned a // callee-saved register. def : Pat<(X86tcret (load addr:$dst), imm:$off), (TCRETURNmi addr:$dst, imm:$off)>, - Requires<[Not64BitMode, IsNotPIC]>; + Requires<[Not64BitMode, IsNotPIC, NotUseRetpoline]>; def : Pat<(X86tcret (i32 tglobaladdr:$dst), imm:$off), (TCRETURNdi tglobaladdr:$dst, imm:$off)>, @@ -1165,13 +1165,21 @@ def : Pat<(X86tcret (i32 texternalsym:$dst), imm:$off) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Mon Feb 5 16:01:35 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86D82ED788C for ; Mon, 5 Feb 2018 16:01:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3578E79997; Mon, 5 Feb 2018 16:01:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 308372BDC; Mon, 5 Feb 2018 16:01:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15G1ZUL017708; Mon, 5 Feb 2018 16:01:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15G1ZuZ017706; Mon, 5 Feb 2018 16:01:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802051601.w15G1ZuZ017706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Feb 2018 16:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328887 - user/markj/netdump/sys/dev/bge X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: user/markj/netdump/sys/dev/bge X-SVN-Commit-Revision: 328887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 16:01:35 -0000 Author: markj Date: Mon Feb 5 16:01:34 2018 New Revision: 328887 URL: https://svnweb.freebsd.org/changeset/base/328887 Log: Add netdump support to bge(4). Tested with a NetXtreme BCM5727 adapter. Modified: user/markj/netdump/sys/dev/bge/if_bge.c Modified: user/markj/netdump/sys/dev/bge/if_bge.c ============================================================================== --- user/markj/netdump/sys/dev/bge/if_bge.c Mon Feb 5 16:00:30 2018 (r328886) +++ user/markj/netdump/sys/dev/bge/if_bge.c Mon Feb 5 16:01:34 2018 (r328887) @@ -100,6 +100,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -426,8 +427,9 @@ static int bge_encap(struct bge_softc *, struct mbuf * static void bge_intr(void *); static int bge_msi_intr(void *); static void bge_intr_task(void *, int); -static void bge_start_locked(if_t); static void bge_start(if_t); +static void bge_start_locked(if_t); +static void bge_start_tx(struct bge_softc *, uint32_t); static int bge_ioctl(if_t, u_long, caddr_t); static void bge_init_locked(struct bge_softc *); static void bge_init(void *); @@ -517,6 +519,8 @@ static void bge_add_sysctl_stats(struct bge_softc *, s struct sysctl_oid_list *); static int bge_sysctl_stats(SYSCTL_HANDLER_ARGS); +NETDUMP_DEFINE(bge); + static device_method_t bge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bge_probe), @@ -3941,8 +3945,12 @@ again: if (error) { ether_ifdetach(ifp); device_printf(sc->bge_dev, "couldn't set up irq\n"); + goto fail; } + /* Attach driver netdump methods. */ + NETDUMP_SET(ifp, bge); + fail: if (error) bge_detach(dev); @@ -5389,22 +5397,26 @@ bge_start_locked(if_t ifp) if_bpfmtap(ifp, m_head); } - if (count > 0) { - bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); - /* Transmit. */ + if (count > 0) + bge_start_tx(sc, prodidx); +} + +static void +bge_start_tx(struct bge_softc *sc, uint32_t prodidx) +{ + + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Transmit. */ + bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); + /* 5700 b2 errata */ + if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - /* 5700 b2 errata */ - if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) - bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - sc->bge_tx_prodidx = prodidx; + sc->bge_tx_prodidx = prodidx; - /* - * Set a timeout in case the chip goes out to lunch. - */ - sc->bge_timer = BGE_TX_TIMEOUT; - } + /* Set a timeout in case the chip goes out to lunch. */ + sc->bge_timer = BGE_TX_TIMEOUT; } /* @@ -6796,3 +6808,77 @@ bge_get_counter(if_t ifp, ift_counter cnt) return (if_get_counter_default(ifp, cnt)); } } + +#ifdef NETDUMP +static void +bge_netdump_init(if_t ifp, int *nmbufp, int *nclustp) +{ + struct bge_softc *sc; + + sc = if_getsoftc(ifp); + *nmbufp += sc->bge_return_ring_cnt; + *nclustp += sc->bge_return_ring_cnt; +} + +static void +bge_netdump_event(if_t ifp, enum netdump_ev event) +{ + struct bge_softc *sc; + + sc = if_getsoftc(ifp); + switch (event) { + case NETDUMP_START: + sc->bge_flags &= ~BGE_FLAG_JUMBO_STD; + break; + default: + break; + } +} + +static int +bge_netdump_transmit(if_t ifp, struct mbuf *m) +{ + struct bge_softc *sc; + uint32_t prodidx; + int error; + + if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return (1); + + sc = if_getsoftc(ifp); + prodidx = sc->bge_tx_prodidx; + error = bge_encap(sc, &m, &prodidx); + if (error == 0) + bge_start_tx(sc, prodidx); + return (error); +} + +static int +bge_netdump_poll(if_t ifp, int count) +{ + struct bge_softc *sc; + uint32_t rx_prod, tx_cons; + + sc = if_getsoftc(ifp); + + if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) + return (1); + + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + (void)bge_rxeof(sc, rx_prod, 0); + bge_txeof(sc, tx_cons); + return (0); +} +#endif /* NETDUMP */ From owner-svn-src-user@freebsd.org Mon Feb 5 22:21:52 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35690EF4EA7 for ; Mon, 5 Feb 2018 22:21:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBC2D8C9AA; Mon, 5 Feb 2018 22:21:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D69F96E5E; Mon, 5 Feb 2018 22:21:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15MLpTb012907; Mon, 5 Feb 2018 22:21:51 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15MLphJ012904; Mon, 5 Feb 2018 22:21:51 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052221.w15MLphJ012904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 22:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328903 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 22:21:52 -0000 Author: jeff Date: Mon Feb 5 22:21:51 2018 New Revision: 328903 URL: https://svnweb.freebsd.org/changeset/base/328903 Log: Improve vm_page_import by allocating contig pages as long as they are available but allowing fall back when we are fragmented. Honor vm_domain_available() limits on page allocation. Implement an optimistic phys allocator which will return the largest contig region less than or equal to the request. Modified: user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_phys.c user/jeff/numa/sys/vm/vm_phys.h Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Mon Feb 5 21:29:27 2018 (r328902) +++ user/jeff/numa/sys/vm/vm_page.c Mon Feb 5 22:21:51 2018 (r328903) @@ -217,6 +217,12 @@ vm_page_init_cache_zones(void *dummy __unused) for (i = 0; i < vm_ndomains; i++) { vmd = VM_DOMAIN(i); + /* + * Don't allow the page cache to take up more than .25% of + * memory. + */ + if (vmd->vmd_page_count / 400 < 256 * mp_ncpus) + continue; vmd->vmd_pgcache = uma_zcache_create("vm pgcache", sizeof(struct vm_page), NULL, NULL, NULL, NULL, vm_page_import, vm_page_release, vmd, @@ -2182,28 +2188,25 @@ vm_page_import(void *arg, void **store, int cnt, int d { struct vm_domain *vmd; vm_page_t m; - int i; + int i, j, n; vmd = arg; domain = vmd->vmd_domain; - cnt = rounddown2(cnt, 8); + n = 64; /* Starting stride. */ vm_domain_free_lock(vmd); - for (i = 0; i < cnt; i+=8) { - m = vm_phys_alloc_pages(domain, VM_FREELIST_DEFAULT, 3); - if (m == NULL) + for (i = 0; i < cnt; i+=n) { + if (!vm_domain_available(vmd, VM_ALLOC_NORMAL, n)) break; - store[i] = m; + n = vm_phys_alloc_npages(domain, VM_FREELIST_DEFAULT, &m, + MIN(n, cnt-i)); + if (n == 0) + break; + for (j = 0; j < n; j++) + store[i+j] = m++; } if (i != 0) vm_domain_freecnt_adj(vmd, -i); vm_domain_free_unlock(vmd); - cnt = i; - for (i = 0; i < cnt; i++) { - if ((i % 8) == 0) - m = store[i]; - else - store[i] = ++m; - } return (i); } Modified: user/jeff/numa/sys/vm/vm_phys.c ============================================================================== --- user/jeff/numa/sys/vm/vm_phys.c Mon Feb 5 21:29:27 2018 (r328902) +++ user/jeff/numa/sys/vm/vm_phys.c Mon Feb 5 22:21:51 2018 (r328903) @@ -73,14 +73,14 @@ _Static_assert(sizeof(long) * NBBY >= VM_PHYSSEG_MAX, "Too many physsegs."); #ifdef NUMA -struct mem_affinity *mem_affinity; -int *mem_locality; +struct mem_affinity __read_mostly *mem_affinity; +int __read_mostly *mem_locality; #endif -int vm_ndomains = 1; +int __read_mostly vm_ndomains = 1; -struct vm_phys_seg vm_phys_segs[VM_PHYSSEG_MAX]; -int vm_phys_nsegs; +struct vm_phys_seg __read_mostly vm_phys_segs[VM_PHYSSEG_MAX]; +int __read_mostly vm_phys_nsegs; struct vm_phys_fictitious_seg; static int vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg *, @@ -100,18 +100,18 @@ struct vm_phys_fictitious_seg { RB_GENERATE_STATIC(fict_tree, vm_phys_fictitious_seg, node, vm_phys_fictitious_cmp); -static struct rwlock vm_phys_fictitious_reg_lock; +static struct rwlock_padalign vm_phys_fictitious_reg_lock; MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages"); -static struct vm_freelist +static struct vm_freelist __aligned(CACHE_LINE_SIZE) vm_phys_free_queues[MAXMEMDOM][VM_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER]; -static int vm_nfreelists; +static int __read_mostly vm_nfreelists; /* * Provides the mapping from VM_FREELIST_* to free list indices (flind). */ -static int vm_freelist_to_flind[VM_NFREELIST]; +static int __read_mostly vm_freelist_to_flind[VM_NFREELIST]; CTASSERT(VM_FREELIST_DEFAULT == 0); @@ -622,6 +622,26 @@ vm_phys_alloc_pages(int domain, int pool, int order) return (m); } return (NULL); +} + +int +vm_phys_alloc_npages(int domain, int pool, vm_page_t *mp, int cnt) +{ + vm_page_t m; + int order, freelist; + + for (freelist = 0; freelist < VM_NFREELIST; freelist++) { + for (order = fls(cnt) -1; order >= 0; order--) { + m = vm_phys_alloc_freelist_pages(domain, freelist, + pool, order); + if (m != NULL) { + *mp = m; + return (1 << order); + } + } + } + *mp = NULL; + return (0); } /* Modified: user/jeff/numa/sys/vm/vm_phys.h ============================================================================== --- user/jeff/numa/sys/vm/vm_phys.h Mon Feb 5 21:29:27 2018 (r328902) +++ user/jeff/numa/sys/vm/vm_phys.h Mon Feb 5 22:21:51 2018 (r328903) @@ -79,6 +79,7 @@ vm_page_t vm_phys_alloc_contig(int domain, u_long npag vm_page_t vm_phys_alloc_freelist_pages(int domain, int freelist, int pool, int order); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); +int vm_phys_alloc_npages(int domain, int pool, vm_page_t *m, int cnt); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); From owner-svn-src-user@freebsd.org Mon Feb 5 23:01:50 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60109ED2101 for ; Mon, 5 Feb 2018 23:01:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 129C68E11F; Mon, 5 Feb 2018 23:01:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E851E761B; Mon, 5 Feb 2018 23:01:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15N1nZ4036997; Mon, 5 Feb 2018 23:01:49 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15N1nEv036995; Mon, 5 Feb 2018 23:01:49 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052301.w15N1nEv036995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 23:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328904 - in user/jeff/numa/sys: kern sys X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in user/jeff/numa/sys: kern sys X-SVN-Commit-Revision: 328904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 23:01:50 -0000 Author: jeff Date: Mon Feb 5 23:01:49 2018 New Revision: 328904 URL: https://svnweb.freebsd.org/changeset/base/328904 Log: Re-implement the buffer queues with a number of independent silos each having their own space allotment and bufspace daemon. Use a per-cpu clean queue cache in front of the silo clean queue. Move the common queue variables (queue, len, lock) into a structure so they can be aligned and packed together. Implement a REUSE flag to operate as a second chance in buf_recycle() so we don't have to requeue frequently re-used buffers. Move counters to the counter API. Modified: user/jeff/numa/sys/kern/vfs_bio.c user/jeff/numa/sys/kern/vfs_subr.c user/jeff/numa/sys/sys/buf.h user/jeff/numa/sys/sys/bufobj.h Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Mon Feb 5 22:21:51 2018 (r328903) +++ user/jeff/numa/sys/kern/vfs_bio.c Mon Feb 5 23:01:49 2018 (r328904) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -105,7 +106,6 @@ caddr_t unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ struct proc *bufdaemonproc; -struct proc *bufspacedaemonproc; static int inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); @@ -124,11 +124,8 @@ static int vfs_bio_clcheck(struct vnode *vp, int size, static void breada(struct vnode *, daddr_t *, int *, int, struct ucred *, int, void (*)(struct buf *)); static int buf_flush(struct vnode *vp, int); -static int buf_recycle(bool); -static int buf_scan(bool); static int flushbufqueues(struct vnode *, int, int); static void buf_daemon(void); -static void bremfreel(struct buf *bp); static __inline void bd_wakeup(void); static int sysctl_runningspace(SYSCTL_HANDLER_ARGS); static void bufkva_reclaim(vmem_t *, int); @@ -137,28 +134,17 @@ static int buf_import(void *, void **, int, int, int); static void buf_release(void *, void **, int); static void maxbcachebuf_adjust(void); -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) static int sysctl_bufspace(SYSCTL_HANDLER_ARGS); -#endif - int vmiodirenable = TRUE; SYSCTL_INT(_vfs, OID_AUTO, vmiodirenable, CTLFLAG_RW, &vmiodirenable, 0, "Use the VM system for directory writes"); long runningbufspace; SYSCTL_LONG(_vfs, OID_AUTO, runningbufspace, CTLFLAG_RD, &runningbufspace, 0, "Amount of presently outstanding async buffer io"); -static long bufspace; -#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ - defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) SYSCTL_PROC(_vfs, OID_AUTO, bufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RD, - &bufspace, 0, sysctl_bufspace, "L", "Virtual memory used for buffers"); -#else -SYSCTL_LONG(_vfs, OID_AUTO, bufspace, CTLFLAG_RD, &bufspace, 0, - "Physical memory used for buffers"); -#endif -static long bufkvaspace; -SYSCTL_LONG(_vfs, OID_AUTO, bufkvaspace, CTLFLAG_RD, &bufkvaspace, 0, + NULL, 0, sysctl_bufspace, "L", "Physical memory used for buffers"); +static counter_u64_t bufkvaspace; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, bufkvaspace, CTLFLAG_RD, &bufkvaspace, "Kernel virtual memory used for buffers"); static long maxbufspace; SYSCTL_LONG(_vfs, OID_AUTO, maxbufspace, CTLFLAG_RW, &maxbufspace, 0, @@ -178,11 +164,11 @@ SYSCTL_LONG(_vfs, OID_AUTO, hibufspace, CTLFLAG_RW, &h long bufspacethresh; SYSCTL_LONG(_vfs, OID_AUTO, bufspacethresh, CTLFLAG_RW, &bufspacethresh, 0, "Bufspace consumed before waking the daemon to free some"); -static int buffreekvacnt; -SYSCTL_INT(_vfs, OID_AUTO, buffreekvacnt, CTLFLAG_RW, &buffreekvacnt, 0, +static counter_u64_t buffreekvacnt; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, buffreekvacnt, CTLFLAG_RW, &buffreekvacnt, "Number of times we have freed the KVA space from some buffer"); -static int bufdefragcnt; -SYSCTL_INT(_vfs, OID_AUTO, bufdefragcnt, CTLFLAG_RW, &bufdefragcnt, 0, +static counter_u64_t bufdefragcnt; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, bufdefragcnt, CTLFLAG_RW, &bufdefragcnt, "Number of times we have had to repeat buffer allocation to defragment"); static long lorunningspace; SYSCTL_PROC(_vfs, OID_AUTO, lorunningspace, CTLTYPE_LONG | CTLFLAG_MPSAFE | @@ -225,24 +211,26 @@ SYSCTL_INT(_vfs, OID_AUTO, lofreebuffers, CTLFLAG_RW, static int hifreebuffers; SYSCTL_INT(_vfs, OID_AUTO, hifreebuffers, CTLFLAG_RW, &hifreebuffers, 0, "Threshold for clean buffer recycling"); -static int getnewbufcalls; -SYSCTL_INT(_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RW, &getnewbufcalls, 0, - "Number of calls to getnewbuf"); -static int getnewbufrestarts; -SYSCTL_INT(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RW, &getnewbufrestarts, 0, +static counter_u64_t getnewbufcalls; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RD, + &getnewbufcalls, "Number of calls to getnewbuf"); +static counter_u64_t getnewbufrestarts; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RD, + &getnewbufrestarts, "Number of times getnewbuf has had to restart a buffer acquisition"); -static int mappingrestarts; -SYSCTL_INT(_vfs, OID_AUTO, mappingrestarts, CTLFLAG_RW, &mappingrestarts, 0, +static counter_u64_t mappingrestarts; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, mappingrestarts, CTLFLAG_RD, + &mappingrestarts, "Number of times getblk has had to restart a buffer mapping for " "unmapped buffer"); -static int numbufallocfails; -SYSCTL_INT(_vfs, OID_AUTO, numbufallocfails, CTLFLAG_RW, &numbufallocfails, 0, - "Number of times buffer allocations failed"); +static counter_u64_t numbufallocfails; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, numbufallocfails, CTLFLAG_RW, + &numbufallocfails, "Number of times buffer allocations failed"); static int flushbufqtarget = 100; SYSCTL_INT(_vfs, OID_AUTO, flushbufqtarget, CTLFLAG_RW, &flushbufqtarget, 0, "Amount of work to do in flushbufqueues when helping bufdaemon"); -static long notbufdflushes; -SYSCTL_LONG(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, 0, +static counter_u64_t notbufdflushes; +SYSCTL_COUNTER_U64(_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, "Number of dirty buffer flushes done by the bufdaemon helpers"); static long barrierwrites; SYSCTL_LONG(_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW, &barrierwrites, 0, @@ -266,11 +254,6 @@ static struct mtx_padalign __exclusive_cache_line bdlo static struct mtx_padalign __exclusive_cache_line rbreqlock; /* - * Lock that protects needsbuffer and the sleeps/wakeups surrounding it. - */ -static struct rwlock_padalign __exclusive_cache_line nblock; - -/* * Lock that protects bdirtywait. */ static struct mtx_padalign __exclusive_cache_line bdirtylock; @@ -283,11 +266,6 @@ static struct mtx_padalign __exclusive_cache_line bdir static int bd_request; /* - * Request/wakeup point for the bufspace daemon. - */ -static int bufspace_request; - -/* * Request for the buf daemon to write more buffers than is indicated by * lodirtybuf. This may be necessary to push out excess dependencies or * defragment the address space where a simple count of the number of dirty @@ -302,15 +280,6 @@ static int bd_speedupreq; */ static int runningbufreq; -/* - * Synchronization (sleep/wakeup) variable for buffer requests. - * Can contain the VFS_BIO_NEED flags defined below; setting/clearing is done - * by and/or. - * Used in numdirtywakeup(), bufspace_wakeup(), bwillwrite(), - * getnewbuf(), and getblk(). - */ -static volatile int needsbuffer; - /* * Synchronization for bwillwrite() waiters. */ @@ -323,29 +292,65 @@ static int bdirtywait; #define QUEUE_EMPTY 1 /* empty buffer headers */ #define QUEUE_DIRTY 2 /* B_DELWRI buffers */ #define QUEUE_CLEAN 3 /* non-B_DELWRI buffers */ -#define QUEUE_SENTINEL 1024 /* not an queue index, but mark for sentinel */ +#define QUEUE_SENTINEL 4 /* not an queue index, but mark for sentinel */ -/* Maximum number of clean buffer queues. */ -#define CLEAN_QUEUES 16 +struct bufqueue { + struct mtx_padalign bq_lock; + TAILQ_HEAD(, buf) bq_queue; + uint8_t bq_index; + uint16_t bq_cpu; + int bq_len; +} __aligned(CACHE_LINE_SIZE); +#define BQ_LOCKPTR(bq) (&(bq)->bq_lock) +#define BQ_LOCK(bq) mtx_lock(BQ_LOCKPTR((bq))) +#define BQ_UNLOCK(bq) mtx_unlock(BQ_LOCKPTR((bq))) +#define BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) + +struct bufqueue __exclusive_cache_line bqempty; +struct bufqueue __exclusive_cache_line bqdirty; + +struct bufdomain { + struct bufqueue bd_cpuq[MAXCPU]; + struct bufqueue bd_cleanq; + /* Constants */ + long bd_maxbufspace; + long bd_hibufspace; + long bd_lobufspace; + long bd_bufspacethresh; + int bd_hifreebuffers; + int bd_lofreebuffers; + int bd_lim; + /* atomics */ + int bd_wanted; + int __aligned(CACHE_LINE_SIZE) bd_request; + long __aligned(CACHE_LINE_SIZE) bd_bufspace; + int __aligned(CACHE_LINE_SIZE) bd_freebuffers; +} __aligned(CACHE_LINE_SIZE); + +#define BD_LOCKPTR(bd) (&(bd)->bd_cleanq.bq_lock) +#define BD_LOCK(bd) mtx_lock(BD_LOCKPTR((bd))) +#define BD_UNLOCK(bd) mtx_unlock(BD_LOCKPTR((bd))) +#define BD_ASSERT_LOCKED(bd) mtx_assert(BD_LOCKPTR((bd)), MA_OWNED) +#define BD_DOMAIN(bd) (bd - bdclean) + +/* Maximum number of clean buffer domains. */ +#define CLEAN_DOMAINS 8 + /* Configured number of clean queues. */ -static int clean_queues; +static int __read_mostly clean_domains; -/* Maximum number of buffer queues. */ -#define BUFFER_QUEUES (QUEUE_CLEAN + CLEAN_QUEUES) +struct bufdomain __exclusive_cache_line bdclean[CLEAN_DOMAINS]; -/* Queues for free buffers with various properties */ -static TAILQ_HEAD(bqueues, buf) bufqueues[BUFFER_QUEUES] = { { 0 } }; -#ifdef INVARIANTS -static int bq_len[BUFFER_QUEUES]; -#endif +static void bq_remove(struct bufqueue *bq, struct buf *bp); +static void bq_insert(struct bufqueue *bq, struct buf *bp, bool unlock); +static int buf_recycle(struct bufdomain *, bool kva); +static void bq_init(struct bufqueue *bq, int qindex, int cpu, + const char *lockname); +static void bd_init(struct bufdomain *bd); +static int bd_flushall(struct bufdomain *bd); /* - * Lock for each bufqueue - */ -static struct mtx_padalign __exclusive_cache_line bqlocks[BUFFER_QUEUES]; - -/* * per-cpu empty buffer cache. */ uma_zone_t buf_zone; @@ -391,46 +396,34 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS) { long lvalue; int ivalue; + int i; + lvalue = 0; + for (i = 0; i < clean_domains; i++) + lvalue += bdclean[i].bd_bufspace; if (sizeof(int) == sizeof(long) || req->oldlen >= sizeof(long)) - return (sysctl_handle_long(oidp, arg1, arg2, req)); - lvalue = *(long *)arg1; + return (sysctl_handle_long(oidp, &lvalue, 0, req)); if (lvalue > INT_MAX) /* On overflow, still write out a long to trigger ENOMEM. */ return (sysctl_handle_long(oidp, &lvalue, 0, req)); ivalue = lvalue; return (sysctl_handle_int(oidp, &ivalue, 0, req)); } -#endif - +#else static int -bqcleanq(void) +sysctl_bufspace(SYSCTL_HANDLER_ARGS) { - static int nextq; + long lvalue; + int i; - return ((atomic_fetchadd_int(&nextq, 1) % clean_queues) + QUEUE_CLEAN); + lvalue = 0; + for (i = 0; i < clean_domains; i++) + lvalue += bdclean[i].bd_bufspace; + return (sysctl_handle_int(oidp, &lvalue, 0, req)); } +#endif -static int -bqisclean(int qindex) -{ - - return (qindex >= QUEUE_CLEAN && qindex < QUEUE_CLEAN + CLEAN_QUEUES); -} - /* - * bqlock: - * - * Return the appropriate queue lock based on the index. - */ -static inline struct mtx * -bqlock(int qindex) -{ - - return (struct mtx *)&bqlocks[qindex]; -} - -/* * bdirtywakeup: * * Wakeup any bwillwrite() waiters. @@ -481,50 +474,23 @@ bdirtyadd(void) } /* - * bufspace_wakeup: + * bufspace_daemonwakeup: * - * Called when buffer space is potentially available for recovery. - * getnewbuf() will block on this flag when it is unable to free - * sufficient buffer space. Buffer space becomes recoverable when - * bp's get placed back in the queues. + * Wakeup the daemons responsible for freeing clean bufs. */ static void -bufspace_wakeup(void) +bufspace_daemonwakeup(struct bufdomain *bd) { - /* - * If someone is waiting for bufspace, wake them up. - * - * Since needsbuffer is set prior to doing an additional queue - * scan it is safe to check for the flag prior to acquiring the - * lock. The thread that is preparing to scan again before - * blocking would discover the buf we released. - */ - if (needsbuffer) { - rw_rlock(&nblock); - if (atomic_cmpset_int(&needsbuffer, 1, 0) == 1) - wakeup(__DEVOLATILE(void *, &needsbuffer)); - rw_runlock(&nblock); + if (atomic_fetchadd_int(&bd->bd_request, 1) == 0) { + BD_LOCK(bd); + bd->bd_request = 1; + wakeup(&bd->bd_request); + BD_UNLOCK(bd); } } /* - * bufspace_daemonwakeup: - * - * Wakeup the daemon responsible for freeing clean bufs. - */ -static void -bufspace_daemonwakeup(void) -{ - rw_rlock(&nblock); - if (bufspace_request == 0) { - bufspace_request = 1; - wakeup(&bufspace_request); - } - rw_runlock(&nblock); -} - -/* * bufspace_adjust: * * Adjust the reported bufspace for a KVA managed buffer, possibly @@ -533,20 +499,22 @@ bufspace_daemonwakeup(void) static void bufspace_adjust(struct buf *bp, int bufsize) { + struct bufdomain *bd; long space; int diff; KASSERT((bp->b_flags & B_MALLOC) == 0, ("bufspace_adjust: malloc buf %p", bp)); + bd = &bdclean[bp->b_domain]; diff = bufsize - bp->b_bufsize; if (diff < 0) { - atomic_subtract_long(&bufspace, -diff); - bufspace_wakeup(); + atomic_subtract_long(&bd->bd_bufspace, -diff); } else { - space = atomic_fetchadd_long(&bufspace, diff); + space = atomic_fetchadd_long(&bd->bd_bufspace, diff); /* Wake up the daemon on the transition. */ - if (space < bufspacethresh && space + diff >= bufspacethresh) - bufspace_daemonwakeup(); + if (space < bd->bd_bufspacethresh && + space + diff >= bd->bd_bufspacethresh) + bufspace_daemonwakeup(bd); } bp->b_bufsize = bufsize; } @@ -558,24 +526,25 @@ bufspace_adjust(struct buf *bp, int bufsize) * different space limit than data. */ static int -bufspace_reserve(int size, bool metadata) +bufspace_reserve(struct bufdomain *bd, int size, bool metadata) { - long limit; + long limit, new; long space; if (metadata) - limit = maxbufspace; + limit = bd->bd_maxbufspace; else - limit = hibufspace; + limit = bd->bd_hibufspace; do { - space = bufspace; - if (space + size > limit) + space = bd->bd_bufspace; + new = space + size; + if (new > limit) return (ENOSPC); - } while (atomic_cmpset_long(&bufspace, space, space + size) == 0); + } while (atomic_cmpset_long(&bd->bd_bufspace, space, new) == 0); /* Wake up the daemon on the transition. */ - if (space < bufspacethresh && space + size >= bufspacethresh) - bufspace_daemonwakeup(); + if (space < bd->bd_bufspacethresh && new >= bd->bd_bufspacethresh) + bufspace_daemonwakeup(bd); return (0); } @@ -586,21 +555,22 @@ bufspace_reserve(int size, bool metadata) * Release reserved bufspace after bufspace_adjust() has consumed it. */ static void -bufspace_release(int size) +bufspace_release(struct bufdomain *bd, int size) { - atomic_subtract_long(&bufspace, size); - bufspace_wakeup(); + + atomic_subtract_long(&bd->bd_bufspace, size); } /* * bufspace_wait: * * Wait for bufspace, acting as the buf daemon if a locked vnode is - * supplied. needsbuffer must be set in a safe fashion prior to - * polling for space. The operation must be re-tried on return. + * supplied. bd_wanted must be set prior to polling for space. The + * operation must be re-tried on return. */ static void -bufspace_wait(struct vnode *vp, int gbflags, int slpflag, int slptimeo) +bufspace_wait(struct bufdomain *bd, struct vnode *vp, int gbflags, + int slpflag, int slptimeo) { struct thread *td; int error, fl, norunbuf; @@ -609,11 +579,11 @@ bufspace_wait(struct vnode *vp, int gbflags, int slpfl return; td = curthread; - rw_wlock(&nblock); - while (needsbuffer != 0) { + BD_LOCK(bd); + while (bd->bd_wanted) { if (vp != NULL && vp->v_type != VCHR && (td->td_pflags & TDP_BUFNEED) == 0) { - rw_wunlock(&nblock); + BD_UNLOCK(bd); /* * getblk() is called with a vnode locked, and * some majority of the dirty buffers may as @@ -636,18 +606,18 @@ bufspace_wait(struct vnode *vp, int gbflags, int slpfl td->td_pflags |= TDP_BUFNEED | TDP_NORUNNINGBUF; fl = buf_flush(vp, flushbufqtarget); td->td_pflags &= norunbuf; - rw_wlock(&nblock); + BD_LOCK(bd); if (fl != 0) continue; - if (needsbuffer == 0) + if (bd->bd_wanted == 0) break; } - error = rw_sleep(__DEVOLATILE(void *, &needsbuffer), &nblock, + error = msleep(&bd->bd_wanted, BD_LOCKPTR(bd), (PRIBIO + 4) | slpflag, "newbuf", slptimeo); if (error != 0) break; } - rw_wunlock(&nblock); + BD_UNLOCK(bd); } @@ -659,10 +629,13 @@ bufspace_wait(struct vnode *vp, int gbflags, int slpfl * block nor work to reclaim buffers. */ static void -bufspace_daemon(void) +bufspace_daemon(void *arg) { + struct bufdomain *bd; + + bd = arg; for (;;) { - kproc_suspend_check(bufspacedaemonproc); + kproc_suspend_check(curproc); /* * Free buffers from the clean queue until we meet our @@ -689,46 +662,35 @@ bufspace_daemon(void) * which will inefficiently trade bufs with bqrelse * until we return to condition 2. */ - while (bufspace > lobufspace || - numfreebuffers < hifreebuffers) { - if (buf_recycle(false) != 0) { - atomic_set_int(&needsbuffer, 1); - if (buf_recycle(false) != 0) { - rw_wlock(&nblock); - if (needsbuffer) - rw_sleep(__DEVOLATILE(void *, - &needsbuffer), &nblock, - PRIBIO|PDROP, "bufspace", - hz/10); - else - rw_wunlock(&nblock); - } + do { + if (buf_recycle(bd, false) != 0) { + if (bd_flushall(bd)) + continue; + BD_LOCK(bd); + if (bd->bd_wanted) { + msleep(&bd->bd_wanted, BD_LOCKPTR(bd), + PRIBIO|PDROP, "bufspace", hz/10); + } else + BD_UNLOCK(bd); } maybe_yield(); - } + } while (bd->bd_bufspace > bd->bd_lobufspace || + bd->bd_freebuffers < bd->bd_hifreebuffers); /* - * Re-check our limits under the exclusive nblock. + * Re-check our limits and sleep. */ - rw_wlock(&nblock); - if (bufspace < bufspacethresh && - numfreebuffers > lofreebuffers) { - bufspace_request = 0; - rw_sleep(&bufspace_request, &nblock, PRIBIO|PDROP, + BD_LOCK(bd); + if (bd->bd_bufspace < bd->bd_bufspacethresh && + bd->bd_freebuffers > bd->bd_lofreebuffers) { + bd->bd_request = 0; + msleep(&bd->bd_request, BD_LOCKPTR(bd), PRIBIO|PDROP, "-", hz); } else - rw_wunlock(&nblock); + BD_UNLOCK(bd); } } -static struct kproc_desc bufspace_kp = { - "bufspacedaemon", - bufspace_daemon, - &bufspacedaemonproc -}; -SYSINIT(bufspacedaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, - &bufspace_kp); - /* * bufmallocadjust: * @@ -1038,38 +1000,32 @@ bufinit(void) KASSERT(maxbcachebuf >= MAXBSIZE, ("maxbcachebuf (%d) must be >= MAXBSIZE (%d)\n", maxbcachebuf, MAXBSIZE)); - mtx_init(&bqlocks[QUEUE_DIRTY], "bufq dirty lock", NULL, MTX_DEF); - mtx_init(&bqlocks[QUEUE_EMPTY], "bufq empty lock", NULL, MTX_DEF); - for (i = QUEUE_CLEAN; i < QUEUE_CLEAN + CLEAN_QUEUES; i++) - mtx_init(&bqlocks[i], "bufq clean lock", NULL, MTX_DEF); + bq_init(&bqempty, QUEUE_EMPTY, -1, "bufq empty lock"); + bq_init(&bqdirty, QUEUE_DIRTY, -1, "bufq dirty lock"); mtx_init(&rbreqlock, "runningbufspace lock", NULL, MTX_DEF); - rw_init(&nblock, "needsbuffer lock"); mtx_init(&bdlock, "buffer daemon lock", NULL, MTX_DEF); mtx_init(&bdirtylock, "dirty buf lock", NULL, MTX_DEF); - /* next, make a null set of free lists */ - for (i = 0; i < BUFFER_QUEUES; i++) - TAILQ_INIT(&bufqueues[i]); - unmapped_buf = (caddr_t)kva_alloc(MAXPHYS); /* finally, initialize each buffer header and stick on empty q */ + BQ_LOCK(&bqempty); for (i = 0; i < nbuf; i++) { bp = &buf[i]; bzero(bp, sizeof *bp); bp->b_flags = B_INVAL; bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; - bp->b_qindex = QUEUE_EMPTY; + bp->b_qindex = QUEUE_NONE; + bp->b_domain = -1; + bp->b_cpu = -1; bp->b_xflags = 0; bp->b_data = bp->b_kvabase = unmapped_buf; LIST_INIT(&bp->b_dep); BUF_LOCKINIT(bp); - TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist); -#ifdef INVARIANTS - bq_len[QUEUE_EMPTY]++; -#endif + bq_insert(&bqempty, bp, false); } + BQ_UNLOCK(&bqempty); /* * maxbufspace is the absolute maximum amount of buffer space we are @@ -1150,8 +1106,31 @@ bufinit(void) * One queue per-256mb up to the max. More queues gives better * concurrency but less accurate LRU. */ - clean_queues = MIN(howmany(maxbufspace, 256*1024*1024), CLEAN_QUEUES); + clean_domains = MIN(howmany(maxbufspace, 256*1024*1024), CLEAN_DOMAINS); + for (i = 0 ; i < clean_domains; i++) { + struct bufdomain *bd; + bd = &bdclean[i]; + bd_init(bd); + bd->bd_freebuffers = nbuf / clean_domains; + bd->bd_hifreebuffers = hifreebuffers / clean_domains; + bd->bd_lofreebuffers = lofreebuffers / clean_domains; + bd->bd_bufspace = 0; + bd->bd_maxbufspace = maxbufspace / clean_domains; + bd->bd_hibufspace = hibufspace / clean_domains; + bd->bd_lobufspace = lobufspace / clean_domains; + bd->bd_bufspacethresh = bufspacethresh / clean_domains; + /* Don't allow more than 2% of bufs in the per-cpu caches. */ + bd->bd_lim = nbuf / clean_domains / 50 / mp_ncpus; + } + getnewbufcalls = counter_u64_alloc(M_WAITOK); + getnewbufrestarts = counter_u64_alloc(M_WAITOK); + mappingrestarts = counter_u64_alloc(M_WAITOK); + numbufallocfails = counter_u64_alloc(M_WAITOK); + notbufdflushes = counter_u64_alloc(M_WAITOK); + buffreekvacnt = counter_u64_alloc(M_WAITOK); + bufdefragcnt = counter_u64_alloc(M_WAITOK); + bufkvaspace = counter_u64_alloc(M_WAITOK); } #ifdef INVARIANTS @@ -1326,58 +1305,77 @@ bpmap_qenter(struct buf *bp) (vm_offset_t)(bp->b_offset & PAGE_MASK)); } +static struct bufqueue * +bufqueue(struct buf *bp) +{ + struct bufdomain *bd; + + switch (bp->b_qindex) { + case QUEUE_NONE: + /* FALLTHROUGH */ + case QUEUE_SENTINEL: + return (NULL); + case QUEUE_EMPTY: + return (&bqempty); + case QUEUE_DIRTY: + return (&bqdirty); + case QUEUE_CLEAN: + /* FALLTHROUGH */ + break; + default: + panic("bufqueue(%p): Unhandled type %d\n", bp, bp->b_qindex); + } + bd = &bdclean[bp->b_domain]; + if (bp->b_cpu > mp_maxid) + return (&bd->bd_cleanq); + return (&bd->bd_cpuq[bp->b_cpu]); + +} + /* * binsfree: * - * Insert the buffer into the appropriate free list. + * Insert the buffer into the appropriate free list. Requires a + * locked buffer on entry and buffer is unlocked before return. */ static void binsfree(struct buf *bp, int qindex) { - struct mtx *olock, *nlock; + struct bufdomain *bd; + struct bufqueue *bq; - if (qindex != QUEUE_EMPTY) { - BUF_ASSERT_XLOCKED(bp); - } + KASSERT(qindex == QUEUE_CLEAN || qindex == QUEUE_DIRTY, + ("binsfree: Invalid qindex %d", qindex)); + BUF_ASSERT_XLOCKED(bp); /* - * Stick to the same clean queue for the lifetime of the buf to - * limit locking below. Otherwise pick ont sequentially. - */ - if (qindex == QUEUE_CLEAN) { - if (bqisclean(bp->b_qindex)) - qindex = bp->b_qindex; - else - qindex = bqcleanq(); - } - - /* * Handle delayed bremfree() processing. */ - nlock = bqlock(qindex); if (bp->b_flags & B_REMFREE) { - olock = bqlock(bp->b_qindex); - mtx_lock(olock); - bremfreel(bp); - if (olock != nlock) { - mtx_unlock(olock); - mtx_lock(nlock); + if (bp->b_qindex == qindex) { + bp->b_flags |= B_REUSE; + bp->b_flags &= ~B_REMFREE; + BUF_UNLOCK(bp); + return; } + bq = bufqueue(bp); + BQ_LOCK(bq); + bq_remove(bq, bp); + BQ_UNLOCK(bq); + } + if (qindex == QUEUE_CLEAN) { + bd = &bdclean[bp->b_domain]; + if (bd->bd_lim != 0) + bq = &bd->bd_cpuq[PCPU_GET(cpuid)]; + else + bq = &bd->bd_cleanq; } else - mtx_lock(nlock); + bq = &bqdirty; + BQ_LOCK(bq); + bq_insert(bq, bp, true); + BQ_UNLOCK(bq); - if (bp->b_qindex != QUEUE_NONE) - panic("binsfree: free buffer onto another queue???"); - - bp->b_qindex = qindex; - if (bp->b_flags & B_AGE) - TAILQ_INSERT_HEAD(&bufqueues[bp->b_qindex], bp, b_freelist); - else - TAILQ_INSERT_TAIL(&bufqueues[bp->b_qindex], bp, b_freelist); -#ifdef INVARIANTS - bq_len[bp->b_qindex]++; -#endif - mtx_unlock(nlock); + return; } /* @@ -1404,10 +1402,9 @@ buf_free(struct buf *bp) if (!LIST_EMPTY(&bp->b_dep)) buf_deallocate(bp); bufkva_free(bp); + atomic_add_int(&bdclean[bp->b_domain].bd_freebuffers, 1); BUF_UNLOCK(bp); uma_zfree(buf_zone, bp); - atomic_add_int(&numfreebuffers, 1); - bufspace_wakeup(); } /* @@ -1424,15 +1421,15 @@ buf_import(void *arg, void **store, int cnt, int domai struct buf *bp; int i; - mtx_lock(&bqlocks[QUEUE_EMPTY]); + BQ_LOCK(&bqempty); for (i = 0; i < cnt; i++) { - bp = TAILQ_FIRST(&bufqueues[QUEUE_EMPTY]); + bp = TAILQ_FIRST(&bqempty.bq_queue); if (bp == NULL) break; - bremfreel(bp); + bq_remove(&bqempty, bp); store[i] = bp; } - mtx_unlock(&bqlocks[QUEUE_EMPTY]); + BQ_UNLOCK(&bqempty); return (i); } @@ -1447,8 +1444,10 @@ buf_release(void *arg, void **store, int cnt) { int i; + BQ_LOCK(&bqempty); for (i = 0; i < cnt; i++) - binsfree(store[i], QUEUE_EMPTY); + bq_insert(&bqempty, store[i], false); + BQ_UNLOCK(&bqempty); } /* @@ -1457,22 +1456,31 @@ buf_release(void *arg, void **store, int cnt) * Allocate an empty buffer header. */ static struct buf * -buf_alloc(void) +buf_alloc(struct bufdomain *bd) { struct buf *bp; + int freebufs; - bp = uma_zalloc(buf_zone, M_NOWAIT); + /* + * We can only run out of bufs in the buf zone if the average buf + * is less than BKVASIZE. In this case the actual wait/block will + * come from buf_reycle() failing to flush one of these small bufs. + */ + bp = NULL; + freebufs = atomic_fetchadd_int(&bd->bd_freebuffers, -1); + if (freebufs > 0) + bp = uma_zalloc(buf_zone, M_NOWAIT); if (bp == NULL) { - bufspace_daemonwakeup(); - atomic_add_int(&numbufallocfails, 1); + atomic_fetchadd_int(&bd->bd_freebuffers, 1); + bufspace_daemonwakeup(bd); + counter_u64_add(numbufallocfails, 1); return (NULL); } - /* - * Wake-up the bufspace daemon on transition. + * Wake-up the bufspace daemon on transition below threshold. */ - if (atomic_fetchadd_int(&numfreebuffers, -1) == lofreebuffers) - bufspace_daemonwakeup(); + if (freebufs == bd->bd_lofreebuffers) + bufspace_daemonwakeup(bd); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) panic("getnewbuf_empty: Locked buf %p on free queue.", bp); @@ -1488,6 +1496,7 @@ buf_alloc(void) KASSERT(bp->b_kvasize == 0, ("bp: %p still has kva\n", bp)); KASSERT(bp->b_bufsize == 0, ("bp: %p still has bufspace\n", bp)); + bp->b_domain = BD_DOMAIN(bd); bp->b_flags = 0; bp->b_ioflags = 0; bp->b_xflags = 0; @@ -1512,22 +1521,26 @@ buf_alloc(void) } /* - * buf_qrecycle: + * buf_recycle: * * Free a buffer from the given bufqueue. kva controls whether the * freed buf must own some kva resources. This is used for * defragmenting. */ static int -buf_qrecycle(int qindex, bool kva) +buf_recycle(struct bufdomain *bd, bool kva) { + struct bufqueue *bq; struct buf *bp, *nbp; if (kva) - atomic_add_int(&bufdefragcnt, 1); + counter_u64_add(bufdefragcnt, 1); nbp = NULL; - mtx_lock(&bqlocks[qindex]); - nbp = TAILQ_FIRST(&bufqueues[qindex]); + bq = &bd->bd_cleanq; + BQ_LOCK(bq); + KASSERT(BQ_LOCKPTR(bq) == BD_LOCKPTR(bd), + ("buf_recycle: Locks don't match")); + nbp = TAILQ_FIRST(&bq->bq_queue); /* * Run scan, possibly freeing data and/or kva mappings on the fly @@ -1551,6 +1564,18 @@ buf_qrecycle(int qindex, bool kva) continue; /* + * Implement a second chance algorithm for frequently + * accessed buffers. + */ + if ((bp->b_flags & B_REUSE) != 0) { + TAILQ_REMOVE(&bq->bq_queue, bp, b_freelist); + TAILQ_INSERT_TAIL(&bq->bq_queue, bp, b_freelist); + bp->b_flags &= ~B_REUSE; + BUF_UNLOCK(bp); + continue; + } + + /* * Skip buffers with background writes in progress. */ if ((bp->b_vflags & BV_BKGRDINPROG) != 0) { @@ -1558,14 +1583,18 @@ buf_qrecycle(int qindex, bool kva) continue; } - KASSERT(bp->b_qindex == qindex, - ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); + KASSERT(bp->b_qindex == QUEUE_CLEAN, + ("buf_recycle: inconsistent queue %d bp %p", + bp->b_qindex, bp)); + KASSERT(bp->b_domain == BD_DOMAIN(bd), + ("getnewbuf: queue domain %d doesn't match request %ld", + bp->b_domain, BD_DOMAIN(bd))); /* * NOTE: nbp is now entirely invalid. We can only restart * the scan from this point on. */ - bremfreel(bp); - mtx_unlock(&bqlocks[qindex]); + bq_remove(bq, bp); + BQ_UNLOCK(bq); /* * Requeue the background write buffer with error and @@ -1573,70 +1602,21 @@ buf_qrecycle(int qindex, bool kva) */ if ((bp->b_vflags & BV_BKGRDERR) != 0) { bqrelse(bp); - mtx_lock(&bqlocks[qindex]); - nbp = TAILQ_FIRST(&bufqueues[qindex]); + BQ_LOCK(bq); + nbp = TAILQ_FIRST(&bq->bq_queue); continue; } bp->b_flags |= B_INVAL; brelse(bp); return (0); } - mtx_unlock(&bqlocks[qindex]); + bd->bd_wanted = 1; + BQ_UNLOCK(bq); return (ENOBUFS); } /* - * buf_recycle: - * - * Iterate through all clean queues until we find a buf to recycle or - * exhaust the search. - */ -static int -buf_recycle(bool kva) -{ - int qindex, first_qindex; - - qindex = first_qindex = bqcleanq(); - do { - if (buf_qrecycle(qindex, kva) == 0) - return (0); - if (++qindex == QUEUE_CLEAN + clean_queues) - qindex = QUEUE_CLEAN; - } while (qindex != first_qindex); - - return (ENOBUFS); -} - -/* - * buf_scan: - * - * Scan the clean queues looking for a buffer to recycle. needsbuffer - * is set on failure so that the caller may optionally bufspace_wait() - * in a race-free fashion. - */ -static int -buf_scan(bool defrag) -{ - int error; - - /* - * To avoid heavy synchronization and wakeup races we set - * needsbuffer and re-poll before failing. This ensures that - * no frees can be missed between an unsuccessful poll and - * going to sleep in a synchronized fashion. - */ - if ((error = buf_recycle(defrag)) != 0) { - atomic_set_int(&needsbuffer, 1); - bufspace_daemonwakeup(); - error = buf_recycle(defrag); - } - if (error == 0) - atomic_add_int(&getnewbufrestarts, 1); - return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Mon Feb 5 23:03:48 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F04BAED24EF for ; Mon, 5 Feb 2018 23:03:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2D808E424; Mon, 5 Feb 2018 23:03:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DCA27661; Mon, 5 Feb 2018 23:03:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15N3ldm038041; Mon, 5 Feb 2018 23:03:47 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15N3lUY038040; Mon, 5 Feb 2018 23:03:47 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052303.w15N3lUY038040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 23:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328905 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 328905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 23:03:48 -0000 Author: jeff Date: Mon Feb 5 23:03:47 2018 New Revision: 328905 URL: https://svnweb.freebsd.org/changeset/base/328905 Log: Rewrite the pglist batching in pageout to use a queue that can persist across objects so we can potential batch more than a single block worth of frees. Force the flushing of a batch while the object lock is held until the reservation locking is improved to allow delayed frees. Modified: user/jeff/numa/sys/vm/vm_pageout.c Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Mon Feb 5 23:01:49 2018 (r328904) +++ user/jeff/numa/sys/vm/vm_pageout.c Mon Feb 5 23:03:47 2018 (r328905) @@ -1092,25 +1092,60 @@ dolaundry: } } +struct pgo_pglist { + struct pglist pgl; + int count; +}; + +static void +vm_pageout_pglist_init(struct pgo_pglist *pglist) +{ + + TAILQ_INIT(&pglist->pgl); + pglist->count = 0; +} + +static bool +vm_pageout_pglist_append(struct pgo_pglist *pglist, vm_page_t m) +{ + if (vm_page_free_prep(m, false)) { + m->flags &= ~PG_ZERO; + TAILQ_INSERT_TAIL(&pglist->pgl, m, listq); + pglist->count++; + return (true); + } + return (false); +} + +static void +vm_pageout_pglist_flush(struct pgo_pglist *pglist, bool force) +{ + if (pglist->count > 64 || (force && pglist->count != 0)) { + vm_page_free_phys_pglist(&pglist->pgl); + vm_pageout_pglist_init(pglist); + } +} + + static int -vm_pageout_free_pages(vm_object_t object, vm_page_t m) +vm_pageout_free_pages(struct pgo_pglist *pglist, vm_object_t object, + vm_page_t m) { vm_page_t p, pp; struct mtx *mtx; - struct pglist pgl; vm_pindex_t start; int pcount, count; pcount = MAX(object->iosize / PAGE_SIZE, 1); + count = 0; if (pcount == 1) { - vm_page_free(m); + if (vm_pageout_pglist_append(pglist, m)) + count = 1; vm_page_unlock(m); + vm_pageout_pglist_flush(pglist, vm_object_reserv(object)); VM_OBJECT_WUNLOCK(object); - count = 1; goto out; } - TAILQ_INIT(&pgl); - count = 0; /* Find the first page in the block. */ start = m->pindex - (m->pindex % pcount); @@ -1118,51 +1153,44 @@ vm_pageout_free_pages(vm_object_t object, vm_page_t m) p = pp); /* Free the original page so we don't validate it twice. */ + mtx = vm_page_lockptr(m); if (p == m) p = vm_page_next(m); - if (vm_page_free_prep(m, false)) { - m->flags &= ~PG_ZERO; - TAILQ_INSERT_TAIL(&pgl, m, listq); + if (vm_pageout_pglist_append(pglist, m)) count++; - } - /* Iterate through the block range and free compatible pages. */ - mtx = vm_page_lockptr(m); - for ( ; p != NULL && p->pindex < start + pcount; p = pp) { - pp = TAILQ_NEXT(p, listq); - if (mtx != vm_page_lockptr(p)) { + for (m = p; m != NULL && m->pindex < start + pcount; m = p) { + p = TAILQ_NEXT(m, listq); + if (mtx != vm_page_lockptr(m)) { mtx_unlock(mtx); - mtx = vm_page_lockptr(p); + mtx = vm_page_lockptr(m); mtx_lock(mtx); } - if (p->hold_count || vm_page_busied(p) || - p->queue != PQ_INACTIVE) + if (m->hold_count || vm_page_busied(m) || + m->queue != PQ_INACTIVE) continue; - if (p->valid == 0) + if (m->valid == 0) goto free_page; - if ((p->aflags & PGA_REFERENCED) != 0) + if ((m->aflags & PGA_REFERENCED) != 0) continue; if (object->ref_count != 0) { - if (pmap_ts_referenced(p)) { - vm_page_aflag_set(p, PGA_REFERENCED); + if (pmap_ts_referenced(m)) { + vm_page_aflag_set(m, PGA_REFERENCED); continue; } - vm_page_test_dirty(p); - if (p->dirty == 0) - pmap_remove_all(p); + vm_page_test_dirty(m); + if (m->dirty == 0) + pmap_remove_all(m); } - if (p->dirty) + if (m->dirty) continue; free_page: - if (vm_page_free_prep(p, false)) { - p->flags &= ~PG_ZERO; - TAILQ_INSERT_TAIL(&pgl, p, listq); + if (vm_pageout_pglist_append(pglist, m)) count++; - } } mtx_unlock(mtx); + vm_pageout_pglist_flush(pglist, vm_object_reserv(object)); VM_OBJECT_WUNLOCK(object); - vm_page_free_phys_pglist(&pgl); out: VM_CNT_ADD(v_dfree, count); @@ -1181,6 +1209,7 @@ out: static bool vm_pageout_scan(struct vm_domain *vmd, int pass) { + struct pgo_pglist pglist; vm_page_t m, next; struct vm_pagequeue *pq; vm_object_t object; @@ -1236,6 +1265,7 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) */ pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; maxscan = pq->pq_cnt; + vm_pageout_pglist_init(&pglist); vm_pagequeue_lock(pq); queue_locked = TRUE; for (m = TAILQ_FIRST(&pq->pq_pl); @@ -1387,7 +1417,8 @@ unlock_page: */ if (m->dirty == 0) { free_page: - page_shortage -= vm_pageout_free_pages(object, m); + page_shortage -= vm_pageout_free_pages(&pglist, + object, m); goto lock_queue; } else if ((object->flags & OBJ_DEAD) == 0) vm_page_launder(m); @@ -1396,6 +1427,7 @@ drop_page: VM_OBJECT_WUNLOCK(object); lock_queue: if (!queue_locked) { + vm_pageout_pglist_flush(&pglist, false); vm_pagequeue_lock(pq); queue_locked = TRUE; } @@ -1403,6 +1435,7 @@ lock_queue: TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_marker, plinks.q); } vm_pagequeue_unlock(pq); + vm_pageout_pglist_flush(&pglist, true); /* * Wake up the laundry thread so that it can perform any needed From owner-svn-src-user@freebsd.org Mon Feb 5 23:04:14 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C421ED2548 for ; Mon, 5 Feb 2018 23:04:14 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4E708E514; Mon, 5 Feb 2018 23:04:13 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE2A87662; Mon, 5 Feb 2018 23:04:13 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15N4DgE038106; Mon, 5 Feb 2018 23:04:13 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15N4DpD038105; Mon, 5 Feb 2018 23:04:13 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052304.w15N4DpD038105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 23:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328906 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 328906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 23:04:14 -0000 Author: jeff Date: Mon Feb 5 23:04:13 2018 New Revision: 328906 URL: https://svnweb.freebsd.org/changeset/base/328906 Log: Change the default policy back to first-touch. Modified: user/jeff/numa/sys/kern/kern_cpuset.c Modified: user/jeff/numa/sys/kern/kern_cpuset.c ============================================================================== --- user/jeff/numa/sys/kern/kern_cpuset.c Mon Feb 5 23:03:47 2018 (r328905) +++ user/jeff/numa/sys/kern/kern_cpuset.c Mon Feb 5 23:04:13 2018 (r328906) @@ -1340,7 +1340,7 @@ domainset_zero(void) DOMAINSET_ZERO(&dset->ds_mask); for (i = 0; i < vm_ndomains; i++) DOMAINSET_SET(i, &dset->ds_mask); - dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; + dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH; dset->ds_prefer = -1; curthread->td_domain.dr_policy = _domainset_create(dset, NULL); kernel_object->domain.dr_policy = curthread->td_domain.dr_policy; From owner-svn-src-user@freebsd.org Mon Feb 5 23:04:40 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FDC5ED25A0 for ; Mon, 5 Feb 2018 23:04:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A328E5F5; Mon, 5 Feb 2018 23:04:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D6CB7663; Mon, 5 Feb 2018 23:04:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15N4dE4038176; Mon, 5 Feb 2018 23:04:39 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15N4d2J038175; Mon, 5 Feb 2018 23:04:39 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052304.w15N4d2J038175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 23:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328907 - user/jeff/numa/sys/amd64/include X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/amd64/include X-SVN-Commit-Revision: 328907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 23:04:40 -0000 Author: jeff Date: Mon Feb 5 23:04:39 2018 New Revision: 328907 URL: https://svnweb.freebsd.org/changeset/base/328907 Log: Raise the default limit on PA_LOCK_COUNT Modified: user/jeff/numa/sys/amd64/include/vmparam.h Modified: user/jeff/numa/sys/amd64/include/vmparam.h ============================================================================== --- user/jeff/numa/sys/amd64/include/vmparam.h Mon Feb 5 23:04:13 2018 (r328906) +++ user/jeff/numa/sys/amd64/include/vmparam.h Mon Feb 5 23:04:39 2018 (r328907) @@ -144,7 +144,7 @@ #endif #ifdef SMP -#define PA_LOCK_COUNT 256 +#define PA_LOCK_COUNT 1024 #endif /* From owner-svn-src-user@freebsd.org Mon Feb 5 23:14:25 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207CDED6303 for ; Mon, 5 Feb 2018 23:14:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3FEB8ECDC; Mon, 5 Feb 2018 23:14:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9418780C; Mon, 5 Feb 2018 23:14:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15NEOeu043597; Mon, 5 Feb 2018 23:14:24 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NEMbO043571; Mon, 5 Feb 2018 23:14:22 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802052314.w15NEMbO043571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 5 Feb 2018 23:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328908 - in user/jeff/numa: . bin/date bin/dd bin/pax bin/ps bin/sh cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/... X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in user/jeff/numa: . bin/date bin/dd bin/pax bin/ps bin/sh cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/l... X-SVN-Commit-Revision: 328908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 23:14:25 -0000 Author: jeff Date: Mon Feb 5 23:14:20 2018 New Revision: 328908 URL: https://svnweb.freebsd.org/changeset/base/328908 Log: Merge from current Added: user/jeff/numa/contrib/libarchive/cat/test/test_stdin.c - copied unchanged from r328907, head/contrib/libarchive/cat/test/test_stdin.c user/jeff/numa/contrib/libarchive/libarchive/test/test_compat_zip_8.zip.uu - copied unchanged from r328907, head/contrib/libarchive/libarchive/test/test_compat_zip_8.zip.uu user/jeff/numa/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp - copied unchanged from r328907, head/contrib/llvm/lib/CodeGen/IndirectBrExpandPass.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp - copied unchanged from r328907, head/contrib/llvm/lib/Target/X86/X86RetpolineThunks.cpp user/jeff/numa/contrib/lua/src/luaconf.h.dist - copied unchanged from r328907, head/contrib/lua/src/luaconf.h.dist user/jeff/numa/contrib/tzdata/pacificnew - copied unchanged from r328907, head/contrib/tzdata/pacificnew user/jeff/numa/lib/libc/stdlib/strtold.c - copied unchanged from r328907, head/lib/libc/stdlib/strtold.c user/jeff/numa/lib/libc/tests/gen/makecontext_test.c - copied unchanged from r328907, head/lib/libc/tests/gen/makecontext_test.c user/jeff/numa/lib/libc/tests/regex/Makefile.inc - copied unchanged from r328907, head/lib/libc/tests/regex/Makefile.inc user/jeff/numa/lib/libcasper/services/cap_grp/cap_grp.3 - copied unchanged from r328907, head/lib/libcasper/services/cap_grp/cap_grp.3 user/jeff/numa/lib/libcasper/services/cap_random/cap_random.3 - copied unchanged from r328907, head/lib/libcasper/services/cap_random/cap_random.3 user/jeff/numa/lib/libcasper/services/cap_syslog/cap_syslog.3 - copied unchanged from r328907, head/lib/libcasper/services/cap_syslog/cap_syslog.3 user/jeff/numa/lib/libregex/ - copied from r328907, head/lib/libregex/ user/jeff/numa/share/man/man4/bcm283x_pwm.4 - copied unchanged from r328907, head/share/man/man4/bcm283x_pwm.4 user/jeff/numa/stand/common/interp_simple.c - copied unchanged from r328907, head/stand/common/interp_simple.c user/jeff/numa/stand/libsa/abort.c - copied unchanged from r328907, head/stand/libsa/abort.c user/jeff/numa/stand/libsa/libsa.3 - copied unchanged from r328907, head/stand/libsa/libsa.3 user/jeff/numa/stand/libsa/xlocale_private.h - copied unchanged from r328907, head/stand/libsa/xlocale_private.h user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_clkman.c - copied unchanged from r328907, head/sys/arm/broadcom/bcm2835/bcm2835_clkman.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_clkman.h - copied unchanged from r328907, head/sys/arm/broadcom/bcm2835/bcm2835_clkman.h user/jeff/numa/sys/dev/extres/phy/phydev_if.m - copied unchanged from r328907, head/sys/dev/extres/phy/phydev_if.m user/jeff/numa/sys/dev/extres/phy/phynode_if.m - copied unchanged from r328907, head/sys/dev/extres/phy/phynode_if.m user/jeff/numa/sys/dev/usb/controller/ehci_msm.c - copied unchanged from r328907, head/sys/dev/usb/controller/ehci_msm.c user/jeff/numa/sys/mips/include/abi.h - copied unchanged from r328907, head/sys/mips/include/abi.h user/jeff/numa/sys/modules/bcm283x_clkman/ - copied from r328907, head/sys/modules/bcm283x_clkman/ user/jeff/numa/sys/modules/bcm283x_pwm/ - copied from r328907, head/sys/modules/bcm283x_pwm/ user/jeff/numa/sys/powerpc/conf/GENERIC64-NODEBUG - copied unchanged from r328907, head/sys/powerpc/conf/GENERIC64-NODEBUG user/jeff/numa/usr.bin/hexdump/tests/d_od_cflag_a.out - copied unchanged from r328907, head/usr.bin/hexdump/tests/d_od_cflag_a.out user/jeff/numa/usr.bin/hexdump/tests/d_od_cflag_b.out - copied unchanged from r328907, head/usr.bin/hexdump/tests/d_od_cflag_b.out user/jeff/numa/usr.bin/hexdump/tests/od_test.sh - copied unchanged from r328907, head/usr.bin/hexdump/tests/od_test.sh Deleted: user/jeff/numa/contrib/lua/src/luaconf.h user/jeff/numa/stand/forth/pcibios.4th user/jeff/numa/stand/forth/pnp.4th user/jeff/numa/stand/libsa/libstand.3 user/jeff/numa/stand/libsa/strtol.c user/jeff/numa/stand/libsa/strtoul.c user/jeff/numa/sys/arm/conf/EA3250 user/jeff/numa/sys/arm/lpc/files.lpc user/jeff/numa/sys/arm/lpc/if_lpe.c user/jeff/numa/sys/arm/lpc/if_lpereg.h user/jeff/numa/sys/arm/lpc/lpc_dmac.c user/jeff/numa/sys/arm/lpc/lpc_fb.c user/jeff/numa/sys/arm/lpc/lpc_gpio.c user/jeff/numa/sys/arm/lpc/lpc_intc.c user/jeff/numa/sys/arm/lpc/lpc_machdep.c user/jeff/numa/sys/arm/lpc/lpc_mmc.c user/jeff/numa/sys/arm/lpc/lpc_ohci.c user/jeff/numa/sys/arm/lpc/lpc_pll.c user/jeff/numa/sys/arm/lpc/lpc_pwr.c user/jeff/numa/sys/arm/lpc/lpc_rtc.c user/jeff/numa/sys/arm/lpc/lpc_spi.c user/jeff/numa/sys/arm/lpc/lpc_timer.c user/jeff/numa/sys/arm/lpc/lpcreg.h user/jeff/numa/sys/arm/lpc/lpcvar.h user/jeff/numa/sys/arm/lpc/ssd1289.c user/jeff/numa/sys/arm/lpc/std.lpc user/jeff/numa/sys/dev/extres/phy/phy_if.m user/jeff/numa/sys/dev/uart/uart_dev_lpc.c user/jeff/numa/sys/modules/rpi_pwm/ Modified: user/jeff/numa/Makefile.inc1 user/jeff/numa/Makefile.libcompat user/jeff/numa/ObsoleteFiles.inc user/jeff/numa/bin/date/date.c user/jeff/numa/bin/dd/dd.c user/jeff/numa/bin/pax/pax.c user/jeff/numa/bin/ps/keyword.c user/jeff/numa/bin/ps/ps.1 user/jeff/numa/bin/sh/jobs.c user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs.8 user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c user/jeff/numa/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h user/jeff/numa/cddl/lib/libdtrace/tcp.d user/jeff/numa/cddl/usr.sbin/zfsd/case_file.cc user/jeff/numa/contrib/blacklist/libexec/blacklistd-helper user/jeff/numa/contrib/compiler-rt/lib/builtins/clear_cache.c user/jeff/numa/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h user/jeff/numa/contrib/jemalloc/FREEBSD-diffs user/jeff/numa/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h user/jeff/numa/contrib/libarchive/cat/bsdcat.c user/jeff/numa/contrib/libarchive/libarchive/archive_acl.c user/jeff/numa/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c user/jeff/numa/contrib/libarchive/libarchive/archive_match.c user/jeff/numa/contrib/libarchive/libarchive/archive_platform.h user/jeff/numa/contrib/libarchive/libarchive/archive_ppmd7.c user/jeff/numa/contrib/libarchive/libarchive/archive_ppmd7_private.h user/jeff/numa/contrib/libarchive/libarchive/archive_ppmd_private.h user/jeff/numa/contrib/libarchive/libarchive/archive_read.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_disk_posix.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_support_format_7zip.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_support_format_mtree.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_support_format_rar.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_support_format_tar.c user/jeff/numa/contrib/libarchive/libarchive/archive_read_support_format_zip.c user/jeff/numa/contrib/libarchive/libarchive/archive_util.c user/jeff/numa/contrib/libarchive/libarchive/archive_virtual.c user/jeff/numa/contrib/libarchive/libarchive/archive_write.c user/jeff/numa/contrib/libarchive/libarchive/archive_write_disk_posix.c user/jeff/numa/contrib/libarchive/libarchive/archive_write_set_format_7zip.c user/jeff/numa/contrib/libarchive/libarchive/test/read_open_memory.c user/jeff/numa/contrib/libarchive/libarchive/test/test.h user/jeff/numa/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c user/jeff/numa/contrib/libarchive/libarchive/test/test_compat_zip.c user/jeff/numa/contrib/libarchive/libarchive/test/test_read_format_zip.c user/jeff/numa/contrib/libarchive/libarchive/test/test_write_disk_perms.c user/jeff/numa/contrib/libarchive/tar/test/test_option_acls.c user/jeff/numa/contrib/llvm/include/llvm/Analysis/RegionInfoImpl.h user/jeff/numa/contrib/llvm/include/llvm/Analysis/ValueTracking.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/Passes.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/TargetInstrInfo.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/TargetLowering.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/TargetPassConfig.h user/jeff/numa/contrib/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h user/jeff/numa/contrib/llvm/include/llvm/InitializePasses.h user/jeff/numa/contrib/llvm/include/llvm/MC/MCCodeView.h user/jeff/numa/contrib/llvm/include/llvm/MC/MCFragment.h user/jeff/numa/contrib/llvm/include/llvm/MC/MCObjectStreamer.h user/jeff/numa/contrib/llvm/include/llvm/MC/MCStreamer.h user/jeff/numa/contrib/llvm/include/llvm/Support/GenericDomTreeConstruction.h user/jeff/numa/contrib/llvm/lib/Analysis/ValueTracking.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/CodeGen.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/GlobalMerge.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/RegAllocFast.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp user/jeff/numa/contrib/llvm/lib/CodeGen/TargetSubtargetInfo.cpp user/jeff/numa/contrib/llvm/lib/Linker/IRMover.cpp user/jeff/numa/contrib/llvm/lib/MC/MCAsmStreamer.cpp user/jeff/numa/contrib/llvm/lib/MC/MCAssembler.cpp user/jeff/numa/contrib/llvm/lib/MC/MCCodeView.cpp user/jeff/numa/contrib/llvm/lib/MC/MCMachOStreamer.cpp user/jeff/numa/contrib/llvm/lib/MC/MCObjectStreamer.cpp user/jeff/numa/contrib/llvm/lib/MC/MCStreamer.cpp user/jeff/numa/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp user/jeff/numa/contrib/llvm/lib/MC/WasmObjectWriter.cpp user/jeff/numa/contrib/llvm/lib/Target/AArch64/AArch64FastISel.cpp user/jeff/numa/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp user/jeff/numa/contrib/llvm/lib/Target/AArch64/AArch64Subtarget.cpp user/jeff/numa/contrib/llvm/lib/Target/AMDGPU/SIInsertSkips.cpp user/jeff/numa/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp user/jeff/numa/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp user/jeff/numa/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.h user/jeff/numa/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp user/jeff/numa/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp user/jeff/numa/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp user/jeff/numa/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp user/jeff/numa/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h user/jeff/numa/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td user/jeff/numa/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86.h user/jeff/numa/contrib/llvm/lib/Target/X86/X86.td user/jeff/numa/contrib/llvm/lib/Target/X86/X86AsmPrinter.h user/jeff/numa/contrib/llvm/lib/Target/X86/X86FastISel.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86ISelLowering.h user/jeff/numa/contrib/llvm/lib/Target/X86/X86InstrCompiler.td user/jeff/numa/contrib/llvm/lib/Target/X86/X86InstrControl.td user/jeff/numa/contrib/llvm/lib/Target/X86/X86InstrInfo.td user/jeff/numa/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86Subtarget.cpp user/jeff/numa/contrib/llvm/lib/Target/X86/X86Subtarget.h user/jeff/numa/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Scalar/GVNHoist.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp user/jeff/numa/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp user/jeff/numa/contrib/llvm/tools/clang/include/clang/Basic/Attr.td user/jeff/numa/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def user/jeff/numa/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td user/jeff/numa/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td user/jeff/numa/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def user/jeff/numa/contrib/llvm/tools/clang/include/clang/Driver/Options.td user/jeff/numa/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h user/jeff/numa/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/AST/ODRHash.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h user/jeff/numa/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Driver/ToolChains/Clang.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Driver/ToolChains/Hexagon.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Lex/PPCaching.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Sema/Scope.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp user/jeff/numa/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp user/jeff/numa/contrib/llvm/tools/lld/COFF/Driver.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/AArch64ErrataFix.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/Arch/X86.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/Arch/X86_64.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/Config.h user/jeff/numa/contrib/llvm/tools/lld/ELF/Driver.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/LinkerScript.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/LinkerScript.h user/jeff/numa/contrib/llvm/tools/lld/ELF/OutputSections.h user/jeff/numa/contrib/llvm/tools/lld/ELF/ScriptParser.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/SymbolTable.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/SyntheticSections.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/Writer.cpp user/jeff/numa/contrib/llvm/tools/lld/ELF/Writer.h user/jeff/numa/contrib/llvm/tools/llvm-readobj/MachODumper.cpp user/jeff/numa/contrib/llvm/tools/opt/opt.cpp user/jeff/numa/contrib/lua/src/lstrlib.c user/jeff/numa/contrib/netbsd-tests/kernel/t_sysv.c user/jeff/numa/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c user/jeff/numa/contrib/netbsd-tests/lib/libc/sys/t_mlock.c user/jeff/numa/contrib/netbsd-tests/usr.bin/grep/t_grep.sh user/jeff/numa/contrib/tnftp/src/cmds.c user/jeff/numa/contrib/traceroute/traceroute.c user/jeff/numa/contrib/tzdata/Makefile user/jeff/numa/contrib/tzdata/NEWS user/jeff/numa/contrib/tzdata/README user/jeff/numa/contrib/tzdata/asia user/jeff/numa/contrib/tzdata/europe user/jeff/numa/contrib/tzdata/leap-seconds.list user/jeff/numa/contrib/tzdata/leapseconds user/jeff/numa/contrib/tzdata/theory.html user/jeff/numa/contrib/tzdata/version user/jeff/numa/contrib/tzdata/zishrink.awk user/jeff/numa/crypto/openssl/ssl/srtp.h user/jeff/numa/etc/Makefile user/jeff/numa/etc/mtree/BSD.root.dist user/jeff/numa/etc/mtree/BSD.tests.dist user/jeff/numa/etc/rc.subr user/jeff/numa/etc/regdomain.xml user/jeff/numa/include/err.h user/jeff/numa/include/stdlib.h user/jeff/numa/lib/Makefile user/jeff/numa/lib/clang/freebsd_cc_version.h user/jeff/numa/lib/clang/include/clang/Basic/Version.inc user/jeff/numa/lib/clang/include/lld/Common/Version.inc user/jeff/numa/lib/clang/include/llvm/Support/VCSRevision.h user/jeff/numa/lib/clang/libllvm/Makefile user/jeff/numa/lib/libarchive/tests/Makefile user/jeff/numa/lib/libc/gen/getgrent.c user/jeff/numa/lib/libc/gen/makecontext.3 user/jeff/numa/lib/libc/i386/gen/makecontext.c user/jeff/numa/lib/libc/mips/gen/_ctx_start.S user/jeff/numa/lib/libc/mips/gen/makecontext.c user/jeff/numa/lib/libc/powerpc/gen/makecontext.c user/jeff/numa/lib/libc/powerpc64/gen/makecontext.c user/jeff/numa/lib/libc/regex/Makefile.inc user/jeff/numa/lib/libc/regex/engine.c user/jeff/numa/lib/libc/regex/regcomp.c user/jeff/numa/lib/libc/sparc64/sys/__sparc_utrap_setup.c user/jeff/numa/lib/libc/stdlib/Makefile.inc user/jeff/numa/lib/libc/stdlib/strtol.c user/jeff/numa/lib/libc/sys/mlock.2 user/jeff/numa/lib/libc/sys/setgroups.2 user/jeff/numa/lib/libc/sys/shmat.2 user/jeff/numa/lib/libc/tests/gen/Makefile user/jeff/numa/lib/libc/tests/regex/Makefile user/jeff/numa/lib/libcasper/libcasper/libcasper.3 user/jeff/numa/lib/libcasper/libcasper/libcasper.c user/jeff/numa/lib/libcasper/libcasper/libcasper.h user/jeff/numa/lib/libcasper/libcasper/libcasper_impl.c user/jeff/numa/lib/libcasper/libcasper/libcasper_impl.h user/jeff/numa/lib/libcasper/libcasper/libcasper_service.c user/jeff/numa/lib/libcasper/libcasper/libcasper_service.h user/jeff/numa/lib/libcasper/libcasper/service.c user/jeff/numa/lib/libcasper/libcasper/zygote.c user/jeff/numa/lib/libcasper/libcasper/zygote.h user/jeff/numa/lib/libcasper/services/cap_dns/cap_dns.c user/jeff/numa/lib/libcasper/services/cap_dns/tests/dns_test.c user/jeff/numa/lib/libcasper/services/cap_grp/Makefile user/jeff/numa/lib/libcasper/services/cap_grp/cap_grp.c user/jeff/numa/lib/libcasper/services/cap_grp/tests/grp_test.c user/jeff/numa/lib/libcasper/services/cap_pwd/cap_pwd.c user/jeff/numa/lib/libcasper/services/cap_pwd/tests/pwd_test.c user/jeff/numa/lib/libcasper/services/cap_random/Makefile user/jeff/numa/lib/libcasper/services/cap_random/cap_random.c user/jeff/numa/lib/libcasper/services/cap_sysctl/cap_sysctl.c user/jeff/numa/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c user/jeff/numa/lib/libcasper/services/cap_syslog/Makefile user/jeff/numa/lib/libcasper/services/cap_syslog/cap_syslog.c user/jeff/numa/lib/libcompiler_rt/Makefile.inc user/jeff/numa/lib/libcxxrt/Version.map user/jeff/numa/lib/libedit/Makefile user/jeff/numa/lib/libgcc_s/Makefile user/jeff/numa/lib/libiconv_modules/ISO2022/citrus_iso2022.c user/jeff/numa/lib/libthr/thread/thr_printf.c user/jeff/numa/lib/libufs/Makefile user/jeff/numa/lib/libufs/cgread.3 user/jeff/numa/lib/libufs/libufs.h user/jeff/numa/lib/libufs/sblock.c user/jeff/numa/lib/libufs/sbread.3 user/jeff/numa/libexec/getty/extern.h user/jeff/numa/libexec/getty/init.c user/jeff/numa/libexec/getty/main.c user/jeff/numa/libexec/getty/subr.c user/jeff/numa/libexec/rtld-elf/aarch64/reloc.c user/jeff/numa/libexec/rtld-elf/amd64/reloc.c user/jeff/numa/libexec/rtld-elf/arm/reloc.c user/jeff/numa/libexec/rtld-elf/i386/reloc.c user/jeff/numa/libexec/rtld-elf/mips/reloc.c user/jeff/numa/libexec/rtld-elf/powerpc/reloc.c user/jeff/numa/libexec/rtld-elf/powerpc64/reloc.c user/jeff/numa/libexec/rtld-elf/riscv/reloc.c user/jeff/numa/libexec/rtld-elf/rtld.c user/jeff/numa/libexec/rtld-elf/rtld.h user/jeff/numa/libexec/rtld-elf/sparc64/reloc.c user/jeff/numa/release/release.sh user/jeff/numa/release/scripts/make-manifest.sh user/jeff/numa/sbin/clri/Makefile user/jeff/numa/sbin/clri/clri.c user/jeff/numa/sbin/decryptcore/decryptcore.8 user/jeff/numa/sbin/devd/devd.cc user/jeff/numa/sbin/dhclient/dhclient.c user/jeff/numa/sbin/dump/Makefile user/jeff/numa/sbin/dump/dump.h user/jeff/numa/sbin/dump/main.c user/jeff/numa/sbin/etherswitchcfg/etherswitchcfg.c user/jeff/numa/sbin/fsck_ffs/fsck.h user/jeff/numa/sbin/fsck_ffs/fsutil.c user/jeff/numa/sbin/fsck_ffs/gjournal.c user/jeff/numa/sbin/fsck_ffs/globs.c user/jeff/numa/sbin/fsck_ffs/setup.c user/jeff/numa/sbin/fsck_ffs/suj.c user/jeff/numa/sbin/fsirand/Makefile user/jeff/numa/sbin/fsirand/fsirand.c user/jeff/numa/sbin/geom/class/cache/geom_cache.c user/jeff/numa/sbin/geom/class/concat/geom_concat.c user/jeff/numa/sbin/geom/class/journal/geom_journal.c user/jeff/numa/sbin/geom/class/label/geom_label.c user/jeff/numa/sbin/geom/class/mirror/geom_mirror.c user/jeff/numa/sbin/geom/class/raid3/geom_raid3.c user/jeff/numa/sbin/geom/class/shsec/geom_shsec.c user/jeff/numa/sbin/geom/class/stripe/geom_stripe.c user/jeff/numa/sbin/geom/misc/subr.c user/jeff/numa/sbin/growfs/growfs.c user/jeff/numa/sbin/newfs/mkfs.c user/jeff/numa/sbin/pfctl/pfctl_optimize.c user/jeff/numa/sbin/quotacheck/Makefile user/jeff/numa/sbin/quotacheck/quotacheck.c user/jeff/numa/share/examples/bhyve/vmrun.sh user/jeff/numa/share/examples/kld/cdev/module/cdev.c user/jeff/numa/share/examples/kld/cdev/module/cdevmod.c user/jeff/numa/share/man/man3/pthread_join.3 user/jeff/numa/share/man/man4/Makefile user/jeff/numa/share/man/man4/nmdm.4 user/jeff/numa/share/man/man4/usb_template.4 user/jeff/numa/share/man/man7/arch.7 user/jeff/numa/share/man/man7/hier.7 user/jeff/numa/share/man/man8/Makefile user/jeff/numa/share/man/man8/uefi.8 user/jeff/numa/share/man/man9/malloc.9 user/jeff/numa/share/man/man9/style.9 user/jeff/numa/share/mk/bsd.libnames.mk user/jeff/numa/share/mk/bsd.sys.mk user/jeff/numa/share/mk/src.libnames.mk user/jeff/numa/share/termcap/termcap user/jeff/numa/share/vt/keymaps/us.kbd user/jeff/numa/stand/arm/uboot/Makefile user/jeff/numa/stand/common/boot.c user/jeff/numa/stand/common/bootstrap.h user/jeff/numa/stand/common/commands.c user/jeff/numa/stand/common/install.c user/jeff/numa/stand/common/interp.c user/jeff/numa/stand/common/interp_forth.c user/jeff/numa/stand/common/load_elf.c user/jeff/numa/stand/common/misc.c user/jeff/numa/stand/common/pnp.c user/jeff/numa/stand/defs.mk user/jeff/numa/stand/efi/boot1/Makefile user/jeff/numa/stand/efi/fdt/Makefile user/jeff/numa/stand/efi/fdt/efi_fdt.c user/jeff/numa/stand/efi/include/efiapi.h user/jeff/numa/stand/efi/libefi/Makefile user/jeff/numa/stand/efi/libefi/env.c user/jeff/numa/stand/efi/loader/Makefile user/jeff/numa/stand/efi/loader/main.c user/jeff/numa/stand/fdt/Makefile user/jeff/numa/stand/fdt/fdt_loader_cmd.c user/jeff/numa/stand/fdt/fdt_platform.h user/jeff/numa/stand/ficl.mk user/jeff/numa/stand/ficl/Makefile user/jeff/numa/stand/forth/Makefile user/jeff/numa/stand/forth/loader.4th user/jeff/numa/stand/geli/Makefile user/jeff/numa/stand/i386/boot0/Makefile user/jeff/numa/stand/i386/btx/btx/Makefile user/jeff/numa/stand/i386/btx/btxldr/Makefile user/jeff/numa/stand/i386/btx/lib/Makefile user/jeff/numa/stand/i386/cdboot/Makefile user/jeff/numa/stand/i386/gptboot/gptboot.c user/jeff/numa/stand/i386/kgzldr/Makefile user/jeff/numa/stand/i386/libfirewire/Makefile user/jeff/numa/stand/i386/libi386/Makefile user/jeff/numa/stand/i386/libi386/biospci.c user/jeff/numa/stand/i386/loader/Makefile user/jeff/numa/stand/i386/mbr/Makefile user/jeff/numa/stand/i386/pmbr/Makefile user/jeff/numa/stand/libsa/Makefile user/jeff/numa/stand/libsa/environment.c user/jeff/numa/stand/libsa/panic.c user/jeff/numa/stand/libsa/stand.h user/jeff/numa/stand/libsa/ufs.c user/jeff/numa/stand/loader.mk user/jeff/numa/stand/mips/beri/boot2/Makefile user/jeff/numa/stand/mips/beri/boot2/boot2.c user/jeff/numa/stand/mips/beri/loader/Makefile user/jeff/numa/stand/mips/beri/loader/main.c user/jeff/numa/stand/mips/uboot/Makefile user/jeff/numa/stand/mips/uboot/conf.c user/jeff/numa/stand/ofw/common/main.c user/jeff/numa/stand/ofw/libofw/Makefile user/jeff/numa/stand/ofw/libofw/elf_freebsd.c user/jeff/numa/stand/ofw/libofw/libofw.h user/jeff/numa/stand/ofw/libofw/ofw_copy.c user/jeff/numa/stand/ofw/libofw/ofw_memory.c user/jeff/numa/stand/ofw/libofw/ppc64_elf_freebsd.c user/jeff/numa/stand/powerpc/boot1.chrp/Makefile user/jeff/numa/stand/powerpc/kboot/Makefile user/jeff/numa/stand/powerpc/kboot/conf.c user/jeff/numa/stand/powerpc/kboot/host_syscall.S user/jeff/numa/stand/powerpc/kboot/host_syscall.h user/jeff/numa/stand/powerpc/kboot/hostdisk.c user/jeff/numa/stand/powerpc/kboot/kerneltramp.S user/jeff/numa/stand/powerpc/kboot/main.c user/jeff/numa/stand/powerpc/kboot/metadata.c user/jeff/numa/stand/powerpc/kboot/ppc64_elf_freebsd.c user/jeff/numa/stand/powerpc/ofw/Makefile user/jeff/numa/stand/powerpc/ofw/ldscript.powerpc user/jeff/numa/stand/powerpc/uboot/Makefile user/jeff/numa/stand/sparc64/boot1/Makefile user/jeff/numa/stand/sparc64/loader/Makefile user/jeff/numa/stand/uboot/common/main.c user/jeff/numa/stand/uboot/fdt/Makefile user/jeff/numa/stand/uboot/fdt/uboot_fdt.c user/jeff/numa/stand/uboot/lib/Makefile user/jeff/numa/stand/uboot/lib/glue.c user/jeff/numa/stand/uboot/lib/glue.h user/jeff/numa/stand/usb/Makefile.test user/jeff/numa/stand/userboot/test/Makefile user/jeff/numa/stand/userboot/userboot/Makefile user/jeff/numa/stand/zfs/Makefile user/jeff/numa/sys/amd64/amd64/apic_vector.S user/jeff/numa/sys/amd64/amd64/bpf_jit_machdep.c user/jeff/numa/sys/amd64/amd64/db_trace.c user/jeff/numa/sys/amd64/amd64/exception.S user/jeff/numa/sys/amd64/amd64/fpu.c user/jeff/numa/sys/amd64/amd64/genassym.c user/jeff/numa/sys/amd64/amd64/initcpu.c user/jeff/numa/sys/amd64/amd64/machdep.c user/jeff/numa/sys/amd64/amd64/mp_machdep.c user/jeff/numa/sys/amd64/amd64/pmap.c user/jeff/numa/sys/amd64/amd64/support.S user/jeff/numa/sys/amd64/amd64/trap.c user/jeff/numa/sys/amd64/ia32/ia32_exception.S user/jeff/numa/sys/amd64/include/md_var.h user/jeff/numa/sys/amd64/include/pcpu.h user/jeff/numa/sys/amd64/include/pmap.h user/jeff/numa/sys/amd64/include/smp.h user/jeff/numa/sys/amd64/linux/Makefile user/jeff/numa/sys/amd64/linux/linux.h user/jeff/numa/sys/amd64/linux/linux_ptrace.c user/jeff/numa/sys/amd64/linux/linux_support.s user/jeff/numa/sys/amd64/linux/linux_sysvec.c user/jeff/numa/sys/amd64/linux/syscalls.master user/jeff/numa/sys/amd64/linux32/Makefile user/jeff/numa/sys/amd64/linux32/linux.h user/jeff/numa/sys/amd64/linux32/linux32_dummy.c user/jeff/numa/sys/amd64/linux32/linux32_locore.s user/jeff/numa/sys/amd64/linux32/linux32_support.s user/jeff/numa/sys/amd64/linux32/linux32_sysvec.c user/jeff/numa/sys/amd64/linux32/syscalls.master user/jeff/numa/sys/amd64/vmm/amd/svm.c user/jeff/numa/sys/arm/allwinner/a10_ehci.c user/jeff/numa/sys/arm/allwinner/aw_usbphy.c user/jeff/numa/sys/arm/arm/cpuinfo.c user/jeff/numa/sys/arm/arm/genassym.c user/jeff/numa/sys/arm/arm/machdep.c user/jeff/numa/sys/arm/arm/mp_machdep.c user/jeff/numa/sys/arm/arm/swtch-v6.S user/jeff/numa/sys/arm/arm/trap-v6.c user/jeff/numa/sys/arm/broadcom/bcm2835/bcm2835_pwm.c user/jeff/numa/sys/arm/conf/RPI-B user/jeff/numa/sys/arm/freescale/imx/imx_machdep.c user/jeff/numa/sys/arm/freescale/imx/imx_machdep.h user/jeff/numa/sys/arm/freescale/imx/imx_wdog.c user/jeff/numa/sys/arm/freescale/imx/imx_wdogreg.h user/jeff/numa/sys/arm/include/cpuinfo.h user/jeff/numa/sys/arm/include/pcpu.h user/jeff/numa/sys/arm/mv/armada38x/files.armada38x user/jeff/numa/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c user/jeff/numa/sys/arm/nvidia/tegra_ahci.c user/jeff/numa/sys/arm/nvidia/tegra_ehci.c user/jeff/numa/sys/arm/nvidia/tegra_pcie.c user/jeff/numa/sys/arm/nvidia/tegra_usbphy.c user/jeff/numa/sys/arm/nvidia/tegra_xhci.c user/jeff/numa/sys/arm/xilinx/files.zynq7 user/jeff/numa/sys/arm/xscale/ixp425/if_npe.c user/jeff/numa/sys/arm64/arm64/busdma_bounce.c user/jeff/numa/sys/arm64/arm64/cpufunc_asm.S user/jeff/numa/sys/arm64/arm64/pmap.c user/jeff/numa/sys/cam/cam_periph.h user/jeff/numa/sys/cam/cam_queue.c user/jeff/numa/sys/cam/cam_xpt.c user/jeff/numa/sys/cam/ctl/ctl_frontend.c user/jeff/numa/sys/cam/ctl/ctl_frontend_cam_sim.c user/jeff/numa/sys/cam/ctl/scsi_ctl.c user/jeff/numa/sys/cam/nvme/nvme_da.c user/jeff/numa/sys/cam/scsi/scsi_ch.c user/jeff/numa/sys/cam/scsi/scsi_da.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h user/jeff/numa/sys/compat/cloudabi32/Makefile user/jeff/numa/sys/compat/cloudabi64/Makefile user/jeff/numa/sys/compat/freebsd32/Makefile user/jeff/numa/sys/compat/freebsd32/freebsd32_ipc.h user/jeff/numa/sys/compat/linux/check_internal_locks.d user/jeff/numa/sys/compat/linux/linux_emul.c user/jeff/numa/sys/compat/linux/linux_event.c user/jeff/numa/sys/compat/linux/linux_file.h user/jeff/numa/sys/compat/linux/linux_fork.c user/jeff/numa/sys/compat/linux/linux_ioctl.c user/jeff/numa/sys/compat/linux/linux_ioctl.h user/jeff/numa/sys/compat/linux/linux_ipc.c user/jeff/numa/sys/compat/linux/linux_ipc.h user/jeff/numa/sys/compat/linux/linux_ipc64.h user/jeff/numa/sys/compat/linux/linux_misc.c user/jeff/numa/sys/compat/linux/linux_persona.h user/jeff/numa/sys/compat/linux/linux_signal.c user/jeff/numa/sys/compat/linux/linux_socket.c user/jeff/numa/sys/compat/linux/linux_socket.h user/jeff/numa/sys/compat/linux/linux_time.c user/jeff/numa/sys/compat/linux/linux_util.h user/jeff/numa/sys/compat/linux/stats_timing.d user/jeff/numa/sys/compat/linux/trace_futexes.d user/jeff/numa/sys/compat/linuxkpi/common/include/linux/sched.h user/jeff/numa/sys/compat/linuxkpi/common/src/linux_compat.c user/jeff/numa/sys/compat/linuxkpi/common/src/linux_idr.c user/jeff/numa/sys/compat/linuxkpi/common/src/linux_page.c user/jeff/numa/sys/compat/ndis/subr_ndis.c user/jeff/numa/sys/conf/files user/jeff/numa/sys/conf/files.amd64 user/jeff/numa/sys/conf/files.i386 user/jeff/numa/sys/conf/kern.post.mk user/jeff/numa/sys/conf/options user/jeff/numa/sys/contrib/ipfilter/netinet/ip_compat.h user/jeff/numa/sys/contrib/libfdt/fdt.c user/jeff/numa/sys/contrib/libfdt/fdt_overlay.c user/jeff/numa/sys/contrib/libfdt/fdt_ro.c user/jeff/numa/sys/contrib/libfdt/libfdt.h user/jeff/numa/sys/contrib/libnv/cnvlist.c user/jeff/numa/sys/contrib/libnv/dnvlist.c user/jeff/numa/sys/contrib/libnv/nv_impl.h user/jeff/numa/sys/contrib/libnv/nvlist.c user/jeff/numa/sys/contrib/libnv/nvlist_impl.h user/jeff/numa/sys/contrib/libnv/nvpair.c user/jeff/numa/sys/contrib/libnv/nvpair_impl.h user/jeff/numa/sys/crypto/ccp/ccp.c user/jeff/numa/sys/dev/aacraid/aacraid.c user/jeff/numa/sys/dev/advansys/advansys.c user/jeff/numa/sys/dev/advansys/adwcam.c user/jeff/numa/sys/dev/aha/aha.c user/jeff/numa/sys/dev/aic/aic.c user/jeff/numa/sys/dev/ata/ata-isa.c user/jeff/numa/sys/dev/ath/if_ath_rx_edma.c user/jeff/numa/sys/dev/atkbdc/psm.c user/jeff/numa/sys/dev/beri/virtio/virtio.c user/jeff/numa/sys/dev/bhnd/cores/chipc/chipc.c user/jeff/numa/sys/dev/bnxt/if_bnxt.c user/jeff/numa/sys/dev/buslogic/bt.c user/jeff/numa/sys/dev/bwn/if_bwn.c user/jeff/numa/sys/dev/bwn/if_bwn_phy_lp.c user/jeff/numa/sys/dev/ciss/ciss.c user/jeff/numa/sys/dev/cpuctl/cpuctl.c user/jeff/numa/sys/dev/cxgb/cxgb_main.c user/jeff/numa/sys/dev/cxgbe/common/t4_hw.c user/jeff/numa/sys/dev/cxgbe/crypto/t4_crypto.c user/jeff/numa/sys/dev/cxgbe/t4_main.c user/jeff/numa/sys/dev/cxgbe/tom/t4_tom.c user/jeff/numa/sys/dev/dpt/dpt_pci.c user/jeff/numa/sys/dev/drm2/drm_mem_util.h user/jeff/numa/sys/dev/e1000/if_em.c user/jeff/numa/sys/dev/esp/ncr53c9x.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch_7240.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch_8316.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch_8327.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch_9340.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitchreg.h user/jeff/numa/sys/dev/etherswitch/arswitch/arswitchvar.h user/jeff/numa/sys/dev/etherswitch/e6000sw/e6060sw.c user/jeff/numa/sys/dev/etherswitch/etherswitch.c user/jeff/numa/sys/dev/etherswitch/etherswitch.h user/jeff/numa/sys/dev/etherswitch/etherswitch_if.m user/jeff/numa/sys/dev/etherswitch/infineon/adm6996fc.c user/jeff/numa/sys/dev/etherswitch/ip17x/ip17x.c user/jeff/numa/sys/dev/etherswitch/micrel/ksz8995ma.c user/jeff/numa/sys/dev/etherswitch/mtkswitch/mtkswitch.c user/jeff/numa/sys/dev/etherswitch/rtl8366/rtl8366rb.c user/jeff/numa/sys/dev/etherswitch/ukswitch/ukswitch.c user/jeff/numa/sys/dev/extres/clk/clk.c user/jeff/numa/sys/dev/extres/phy/phy.c user/jeff/numa/sys/dev/extres/phy/phy.h user/jeff/numa/sys/dev/fb/splash.c user/jeff/numa/sys/dev/gpio/gpiobus.c user/jeff/numa/sys/dev/if_ndis/if_ndis.c user/jeff/numa/sys/dev/iicbus/ds1307.c user/jeff/numa/sys/dev/iicbus/ds13rtc.c user/jeff/numa/sys/dev/iicbus/iiconf.c user/jeff/numa/sys/dev/iicbus/iiconf.h user/jeff/numa/sys/dev/iicbus/isl12xx.c user/jeff/numa/sys/dev/iicbus/nxprtc.c user/jeff/numa/sys/dev/iscsi/icl_conn_if.m user/jeff/numa/sys/dev/iscsi/icl_soft.c user/jeff/numa/sys/dev/iscsi/icl_wrappers.h user/jeff/numa/sys/dev/iwi/if_iwi.c user/jeff/numa/sys/dev/ixgbe/if_ixv.c user/jeff/numa/sys/dev/ixl/if_ixlv.c user/jeff/numa/sys/dev/ixl/ixl_pf_iov.c user/jeff/numa/sys/dev/ixl/ixl_pf_main.c user/jeff/numa/sys/dev/joy/joy.c user/jeff/numa/sys/dev/kbd/kbd.c user/jeff/numa/sys/dev/liquidio/base/lio_request_manager.c user/jeff/numa/sys/dev/liquidio/lio_main.c user/jeff/numa/sys/dev/mlx5/mlx5_en/en.h user/jeff/numa/sys/dev/mpr/mpr.c user/jeff/numa/sys/dev/mpr/mpr_mapping.c user/jeff/numa/sys/dev/mps/mps.c user/jeff/numa/sys/dev/mps/mps_mapping.c user/jeff/numa/sys/dev/mpt/mpt_cam.c user/jeff/numa/sys/dev/mrsas/mrsas.c user/jeff/numa/sys/dev/mse/mse.c user/jeff/numa/sys/dev/mxge/if_mxge.c user/jeff/numa/sys/dev/ncv/ncr53c500_pccard.c user/jeff/numa/sys/dev/netmap/if_ptnet.c user/jeff/numa/sys/dev/nsp/nsp_pccard.c user/jeff/numa/sys/dev/ntb/ntb_transport.c user/jeff/numa/sys/dev/nvme/nvme.c user/jeff/numa/sys/dev/nvme/nvme_ctrlr.c user/jeff/numa/sys/dev/nvme/nvme_ns.c user/jeff/numa/sys/dev/nvme/nvme_private.h user/jeff/numa/sys/dev/ofw/ofw_bus_subr.c user/jeff/numa/sys/dev/pst/pst-iop.c user/jeff/numa/sys/dev/ral/rt2560.c user/jeff/numa/sys/dev/ral/rt2661.c user/jeff/numa/sys/dev/rp/rp.c user/jeff/numa/sys/dev/rp/rp_isa.c user/jeff/numa/sys/dev/rp/rp_pci.c user/jeff/numa/sys/dev/sbni/if_sbni_isa.c user/jeff/numa/sys/dev/sdhci/sdhci_fdt.c user/jeff/numa/sys/dev/sound/isa/ess.c user/jeff/numa/sys/dev/sound/isa/gusc.c user/jeff/numa/sys/dev/sound/isa/mss.c user/jeff/numa/sys/dev/sound/isa/sbc.c user/jeff/numa/sys/dev/sound/midi/midi.c user/jeff/numa/sys/dev/sound/pci/hda/hdaa.c user/jeff/numa/sys/dev/stg/tmc18c30.c user/jeff/numa/sys/dev/syscons/fire/fire_saver.c user/jeff/numa/sys/dev/uart/uart_dev_mvebu.c user/jeff/numa/sys/dev/usb/controller/generic_ohci.c user/jeff/numa/sys/dev/usb/quirk/usb_quirk.c user/jeff/numa/sys/dev/usb/serial/uslcom.c user/jeff/numa/sys/dev/usb/storage/cfumass.c user/jeff/numa/sys/dev/usb/template/usb_template.c user/jeff/numa/sys/dev/usb/template/usb_template.h user/jeff/numa/sys/dev/usb/template/usb_template_audio.c user/jeff/numa/sys/dev/usb/template/usb_template_cdce.c user/jeff/numa/sys/dev/usb/template/usb_template_kbd.c user/jeff/numa/sys/dev/usb/template/usb_template_midi.c user/jeff/numa/sys/dev/usb/template/usb_template_modem.c user/jeff/numa/sys/dev/usb/template/usb_template_mouse.c user/jeff/numa/sys/dev/usb/template/usb_template_msc.c user/jeff/numa/sys/dev/usb/template/usb_template_mtp.c user/jeff/numa/sys/dev/usb/template/usb_template_phone.c user/jeff/numa/sys/dev/usb/template/usb_template_serialnet.c user/jeff/numa/sys/dev/usb/usb_device.c user/jeff/numa/sys/dev/usb/usbdevs user/jeff/numa/sys/dev/virtio/console/virtio_console.c user/jeff/numa/sys/dev/virtio/mmio/virtio_mmio.c user/jeff/numa/sys/dev/virtio/network/if_vtnet.c user/jeff/numa/sys/dev/virtio/pci/virtio_pci.c user/jeff/numa/sys/dev/vmware/vmxnet3/if_vmx.c user/jeff/numa/sys/dev/vnic/nicvf_queues.c user/jeff/numa/sys/dev/xen/blkback/blkback.c user/jeff/numa/sys/dev/xen/blkfront/blkfront.c user/jeff/numa/sys/dts/arm/bcm2836.dtsi user/jeff/numa/sys/fs/autofs/autofs.h user/jeff/numa/sys/fs/autofs/autofs_ioctl.h user/jeff/numa/sys/fs/autofs/autofs_vfsops.c user/jeff/numa/sys/fs/autofs/autofs_vnops.c user/jeff/numa/sys/fs/cd9660/cd9660_vnops.c user/jeff/numa/sys/fs/ext2fs/ext2_alloc.c user/jeff/numa/sys/fs/ext2fs/ext2_csum.c user/jeff/numa/sys/fs/ext2fs/ext2_extents.c user/jeff/numa/sys/fs/ext2fs/ext2_inode_cnv.c user/jeff/numa/sys/fs/ext2fs/ext2_lookup.c user/jeff/numa/sys/fs/ext2fs/ext2_vfsops.c user/jeff/numa/sys/fs/ext2fs/ext2fs.h user/jeff/numa/sys/fs/nandfs/nandfs_vfsops.c user/jeff/numa/sys/fs/nfs/nfs_commonkrpc.c user/jeff/numa/sys/fs/nfs/nfs_commonsubs.c user/jeff/numa/sys/fs/nfs/nfsport.h user/jeff/numa/sys/fs/nfsclient/nfs_clcomsubs.c user/jeff/numa/sys/fs/nfsclient/nfs_clnode.c user/jeff/numa/sys/fs/nfsclient/nfs_clport.c user/jeff/numa/sys/fs/nfsclient/nfs_clrpcops.c user/jeff/numa/sys/fs/nfsclient/nfs_clstate.c user/jeff/numa/sys/fs/nfsclient/nfs_clsubs.c user/jeff/numa/sys/fs/nfsclient/nfs_clvfsops.c user/jeff/numa/sys/fs/nfsclient/nfs_clvnops.c user/jeff/numa/sys/fs/nfsclient/nfsnode.h user/jeff/numa/sys/fs/nfsserver/nfs_nfsdcache.c user/jeff/numa/sys/fs/nfsserver/nfs_nfsdport.c user/jeff/numa/sys/fs/nfsserver/nfs_nfsdserv.c user/jeff/numa/sys/fs/nfsserver/nfs_nfsdstate.c user/jeff/numa/sys/geom/geom.h user/jeff/numa/sys/geom/geom_io.c user/jeff/numa/sys/geom/journal/g_journal.c user/jeff/numa/sys/geom/journal/g_journal_ufs.c user/jeff/numa/sys/geom/label/g_label.c user/jeff/numa/sys/geom/label/g_label_ufs.c user/jeff/numa/sys/geom/uzip/g_uzip_zlib.c user/jeff/numa/sys/geom/virstor/g_virstor.c user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c user/jeff/numa/sys/i386/i386/bpf_jit_machdep.c user/jeff/numa/sys/i386/i386/k6_mem.c user/jeff/numa/sys/i386/i386/machdep.c user/jeff/numa/sys/i386/i386/npx.c user/jeff/numa/sys/i386/i386/pmap.c user/jeff/numa/sys/i386/i386/support.s user/jeff/numa/sys/i386/i386/vm_machdep.c user/jeff/numa/sys/i386/ibcs2/Makefile user/jeff/numa/sys/i386/linux/Makefile user/jeff/numa/sys/i386/linux/linux.h user/jeff/numa/sys/i386/linux/linux_dummy.c user/jeff/numa/sys/i386/linux/linux_locore.s user/jeff/numa/sys/i386/linux/linux_machdep.c user/jeff/numa/sys/i386/linux/linux_support.s user/jeff/numa/sys/i386/linux/linux_sysvec.c user/jeff/numa/sys/i386/linux/syscalls.master user/jeff/numa/sys/isa/vga_isa.c user/jeff/numa/sys/kern/Makefile user/jeff/numa/sys/kern/init_main.c user/jeff/numa/sys/kern/kern_cpu.c user/jeff/numa/sys/kern/kern_ctf.c user/jeff/numa/sys/kern/kern_exec.c user/jeff/numa/sys/kern/kern_malloc.c user/jeff/numa/sys/kern/kern_pmc.c user/jeff/numa/sys/kern/kern_sysctl.c user/jeff/numa/sys/kern/link_elf_obj.c user/jeff/numa/sys/kern/makesyscalls.sh user/jeff/numa/sys/kern/subr_bus.c user/jeff/numa/sys/kern/subr_hash.c user/jeff/numa/sys/kern/subr_taskqueue.c user/jeff/numa/sys/kern/subr_vmem.c user/jeff/numa/sys/kern/sysv_msg.c user/jeff/numa/sys/kern/sysv_sem.c user/jeff/numa/sys/kern/sysv_shm.c user/jeff/numa/sys/kern/uipc_usrreq.c user/jeff/numa/sys/kern/vfs_default.c user/jeff/numa/sys/kern/vfs_extattr.c user/jeff/numa/sys/kern/vfs_subr.c user/jeff/numa/sys/mips/conf/AP135.hints user/jeff/numa/sys/mips/conf/AP143.hints user/jeff/numa/sys/mips/conf/AR933X_BASE.hints user/jeff/numa/sys/mips/conf/DB120 user/jeff/numa/sys/mips/conf/DB120.hints user/jeff/numa/sys/mips/conf/DIR-825C1.hints user/jeff/numa/sys/mips/conf/QCA953X_BASE user/jeff/numa/sys/mips/conf/QCA953X_BASE.hints user/jeff/numa/sys/mips/conf/QCA955X_BASE.hints user/jeff/numa/sys/mips/conf/std.AR933X user/jeff/numa/sys/mips/conf/std.AR934X user/jeff/numa/sys/mips/conf/std.QCA955X user/jeff/numa/sys/mips/include/asm.h user/jeff/numa/sys/mips/mips/busdma_machdep.c user/jeff/numa/sys/mips/mips/pm_machdep.c user/jeff/numa/sys/mips/mips/vm_machdep.c user/jeff/numa/sys/mips/nlm/dev/sec/nlmrsa.c user/jeff/numa/sys/modules/Makefile user/jeff/numa/sys/modules/cam/Makefile user/jeff/numa/sys/modules/geom/geom_label/Makefile user/jeff/numa/sys/modules/linux/Makefile user/jeff/numa/sys/modules/linux64/Makefile user/jeff/numa/sys/modules/uart/Makefile user/jeff/numa/sys/net/bpf.c user/jeff/numa/sys/net/ieee8023ad_lacp.c user/jeff/numa/sys/net/if_vlan.c user/jeff/numa/sys/net/iflib.c user/jeff/numa/sys/net/route.c user/jeff/numa/sys/net/route.h user/jeff/numa/sys/net/rtsock.c user/jeff/numa/sys/netgraph/ng_bridge.c user/jeff/numa/sys/netgraph/ng_deflate.c user/jeff/numa/sys/netgraph/ng_parse.c user/jeff/numa/sys/netinet/in_kdtrace.c user/jeff/numa/sys/netinet/in_pcb.c user/jeff/numa/sys/netinet/ip_mroute.c user/jeff/numa/sys/netinet/ip_output.c user/jeff/numa/sys/netinet/ip_reass.c user/jeff/numa/sys/netinet/sctp_constants.h user/jeff/numa/sys/netinet/tcp_timer.c user/jeff/numa/sys/netinet/tcp_timer.h user/jeff/numa/sys/netinet6/frag6.c user/jeff/numa/sys/netinet6/in6.c user/jeff/numa/sys/netinet6/in6_ifattach.c user/jeff/numa/sys/netinet6/in6_jail.c user/jeff/numa/sys/netinet6/ip6_input.c user/jeff/numa/sys/netinet6/ip6_mroute.c user/jeff/numa/sys/netinet6/ip6_var.h user/jeff/numa/sys/netinet6/nd6.c user/jeff/numa/sys/netinet6/raw_ip6.c user/jeff/numa/sys/netinet6/scope6.c user/jeff/numa/sys/netipsec/xform_ah.c user/jeff/numa/sys/netpfil/ipfw/ip_fw2.c user/jeff/numa/sys/netpfil/ipfw/ip_fw_sockopt.c user/jeff/numa/sys/netpfil/ipfw/ip_fw_table_algo.c user/jeff/numa/sys/netpfil/pf/pf.c user/jeff/numa/sys/netsmb/smb_crypt.c user/jeff/numa/sys/nfsclient/nfsnode.h user/jeff/numa/sys/opencrypto/cryptodev.c user/jeff/numa/sys/powerpc/aim/aim_machdep.c user/jeff/numa/sys/powerpc/aim/mmu_oea.c user/jeff/numa/sys/powerpc/aim/mmu_oea64.c user/jeff/numa/sys/powerpc/aim/mp_cpudep.c user/jeff/numa/sys/powerpc/aim/trap_subr64.S user/jeff/numa/sys/powerpc/booke/booke_machdep.c user/jeff/numa/sys/powerpc/booke/pmap.c user/jeff/numa/sys/powerpc/conf/MPC85XX user/jeff/numa/sys/powerpc/conf/MPC85XXSPE user/jeff/numa/sys/powerpc/conf/QORIQ64 user/jeff/numa/sys/powerpc/include/pmap.h user/jeff/numa/sys/powerpc/include/psl.h user/jeff/numa/sys/powerpc/include/spr.h user/jeff/numa/sys/powerpc/include/vmparam.h user/jeff/numa/sys/powerpc/mpc85xx/atpic.c user/jeff/numa/sys/powerpc/mpc85xx/mpc85xx_cache.c user/jeff/numa/sys/powerpc/powernv/opal_pci.c user/jeff/numa/sys/powerpc/powernv/platform_powernv.c user/jeff/numa/sys/powerpc/powerpc/exec_machdep.c user/jeff/numa/sys/powerpc/powerpc/genassym.c user/jeff/numa/sys/powerpc/powerpc/intr_machdep.c user/jeff/numa/sys/powerpc/powerpc/machdep.c user/jeff/numa/sys/powerpc/powerpc/mmu_if.m user/jeff/numa/sys/powerpc/powerpc/mp_machdep.c user/jeff/numa/sys/powerpc/powerpc/pmap_dispatch.c user/jeff/numa/sys/powerpc/powerpc/trap.c user/jeff/numa/sys/powerpc/powerpc/vm_machdep.c user/jeff/numa/sys/powerpc/pseries/phyp_vscsi.c user/jeff/numa/sys/powerpc/pseries/platform_chrp.c user/jeff/numa/sys/powerpc/pseries/xics.c user/jeff/numa/sys/sparc64/sparc64/rtc.c user/jeff/numa/sys/sys/cdefs.h user/jeff/numa/sys/sys/copyright.h user/jeff/numa/sys/sys/malloc.h user/jeff/numa/sys/sys/mouse.h user/jeff/numa/sys/sys/systm.h user/jeff/numa/sys/tools/usbdevs2h.awk user/jeff/numa/sys/ufs/ffs/ffs_alloc.c user/jeff/numa/sys/ufs/ffs/ffs_extern.h user/jeff/numa/sys/ufs/ffs/ffs_snapshot.c user/jeff/numa/sys/ufs/ffs/ffs_softdep.c user/jeff/numa/sys/ufs/ffs/ffs_subr.c user/jeff/numa/sys/ufs/ffs/ffs_vfsops.c user/jeff/numa/sys/ufs/ffs/fs.h user/jeff/numa/sys/ufs/ufs/ufs_dirhash.c user/jeff/numa/sys/ufs/ufs/ufs_vnops.c user/jeff/numa/sys/vm/vm_map.c user/jeff/numa/sys/vm/vm_map.h user/jeff/numa/sys/vm/vm_mmap.c user/jeff/numa/sys/vm/vm_object.c user/jeff/numa/sys/vm/vnode_pager.c user/jeff/numa/sys/x86/cpufreq/est.c user/jeff/numa/sys/x86/include/specialreg.h user/jeff/numa/sys/x86/include/x86_smp.h user/jeff/numa/sys/x86/include/x86_var.h user/jeff/numa/sys/x86/isa/atpic.c user/jeff/numa/sys/x86/isa/atrtc.c user/jeff/numa/sys/x86/isa/clock.c user/jeff/numa/sys/x86/isa/isa_dma.c user/jeff/numa/sys/x86/isa/orm.c user/jeff/numa/sys/x86/pci/pci_bus.c user/jeff/numa/sys/x86/x86/cpu_machdep.c user/jeff/numa/sys/x86/x86/identcpu.c user/jeff/numa/sys/x86/x86/local_apic.c user/jeff/numa/sys/x86/x86/mca.c user/jeff/numa/sys/x86/x86/mp_x86.c user/jeff/numa/sys/x86/x86/nexus.c user/jeff/numa/tests/sys/kern/Makefile user/jeff/numa/tests/sys/kern/ptrace_test.c user/jeff/numa/tools/boot/install-boot.sh user/jeff/numa/tools/boot/rootgen.sh user/jeff/numa/tools/tools/README user/jeff/numa/tools/tools/nanobsd/legacy.sh user/jeff/numa/usr.bin/awk/Makefile user/jeff/numa/usr.bin/bsdcat/tests/Makefile user/jeff/numa/usr.bin/clang/lld/ld.lld.1 user/jeff/numa/usr.bin/dtc/Makefile user/jeff/numa/usr.bin/fortune/fortune/fortune.c user/jeff/numa/usr.bin/hexdump/conv.c user/jeff/numa/usr.bin/hexdump/tests/Makefile user/jeff/numa/usr.bin/limits/limits.c user/jeff/numa/usr.bin/m4/extern.h user/jeff/numa/usr.bin/nfsstat/Makefile user/jeff/numa/usr.bin/nfsstat/nfsstat.1 user/jeff/numa/usr.bin/nfsstat/nfsstat.c user/jeff/numa/usr.bin/procstat/procstat.1 user/jeff/numa/usr.bin/sockstat/sockstat.1 user/jeff/numa/usr.bin/sockstat/sockstat.c user/jeff/numa/usr.bin/time/time.c user/jeff/numa/usr.sbin/autofs/automount.c user/jeff/numa/usr.sbin/autofs/automountd.c user/jeff/numa/usr.sbin/autofs/autounmountd.c user/jeff/numa/usr.sbin/autofs/common.c user/jeff/numa/usr.sbin/autofs/common.h user/jeff/numa/usr.sbin/autofs/defined.c user/jeff/numa/usr.sbin/autofs/log.c user/jeff/numa/usr.sbin/autofs/popen.c user/jeff/numa/usr.sbin/autofs/token.l user/jeff/numa/usr.sbin/bsdinstall/partedit/gpart_ops.c user/jeff/numa/usr.sbin/bsdinstall/scripts/auto user/jeff/numa/usr.sbin/ctld/chap.c user/jeff/numa/usr.sbin/ctld/isns.c user/jeff/numa/usr.sbin/ctld/uclparse.c user/jeff/numa/usr.sbin/daemon/daemon.8 user/jeff/numa/usr.sbin/fstyp/Makefile user/jeff/numa/usr.sbin/fstyp/ufs.c user/jeff/numa/usr.sbin/iscsid/chap.c user/jeff/numa/usr.sbin/makefs/tests/makefs_cd9660_tests.sh user/jeff/numa/usr.sbin/newsyslog/newsyslog.8 user/jeff/numa/usr.sbin/pppctl/pppctl.c user/jeff/numa/usr.sbin/quot/Makefile user/jeff/numa/usr.sbin/quot/quot.c user/jeff/numa/usr.sbin/service/service.sh user/jeff/numa/usr.sbin/traceroute6/traceroute6.8 user/jeff/numa/usr.sbin/traceroute6/traceroute6.c user/jeff/numa/usr.sbin/uefisign/child.c user/jeff/numa/usr.sbin/uefisign/magic.h user/jeff/numa/usr.sbin/uefisign/pe.c user/jeff/numa/usr.sbin/uefisign/uefisign.c user/jeff/numa/usr.sbin/uefisign/uefisign.h Directory Properties: user/jeff/numa/ (props changed) user/jeff/numa/cddl/ (props changed) user/jeff/numa/cddl/contrib/opensolaris/ (props changed) user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/ (props changed) user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/jeff/numa/contrib/blacklist/ (props changed) user/jeff/numa/contrib/compiler-rt/ (props changed) user/jeff/numa/contrib/libarchive/ (props changed) user/jeff/numa/contrib/libc++/ (props changed) user/jeff/numa/contrib/llvm/ (props changed) user/jeff/numa/contrib/llvm/tools/clang/ (props changed) user/jeff/numa/contrib/llvm/tools/lld/ (props changed) user/jeff/numa/contrib/llvm/tools/lldb/ (props changed) user/jeff/numa/contrib/netbsd-tests/ (props changed) user/jeff/numa/contrib/tnftp/ (props changed) user/jeff/numa/contrib/tzdata/ (props changed) user/jeff/numa/crypto/openssl/ (props changed) user/jeff/numa/lib/libedit/ (props changed) user/jeff/numa/sys/cddl/contrib/opensolaris/ (props changed) user/jeff/numa/sys/contrib/ipfilter/ (props changed) user/jeff/numa/sys/contrib/libfdt/ (props changed) Modified: user/jeff/numa/Makefile.inc1 ============================================================================== --- user/jeff/numa/Makefile.inc1 Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/Makefile.inc1 Mon Feb 5 23:14:20 2018 (r328908) @@ -144,7 +144,10 @@ TEST_SYSTEM_COMPILER_VARS= \ WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ COMPILER_FREEBSD_VERSION \ - LINKER_TYPE LINKER_FEATURES LINKER_VERSION + X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ + X_COMPILER_FREEBSD_VERSION \ + LINKER_TYPE LINKER_FEATURES LINKER_VERSION \ + X_LINKER_TYPE X_LINKER_FEATURES X_LINKER_VERSION test-system-compiler: .PHONY .for v in ${TEST_SYSTEM_COMPILER_VARS} ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" @@ -637,7 +640,8 @@ XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTM # combined with --sysroot. XCFLAGS+= -B${WORLDTMP}/usr/lib # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif @@ -1443,20 +1447,26 @@ reinstallkernel reinstallkernel.debug: _installcheck_k false .endif @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel ${INSTALLKERNEL}" + @echo ">>> Installing kernel ${INSTALLKERNEL} on $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)" + @echo "--------------------------------------------------------------" .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel ${_kernel}" + @echo ">>> Installing kernel ${_kernel} $$(LC_ALL=C date)" @echo "--------------------------------------------------------------" ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} + @echo "--------------------------------------------------------------" + @echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)" + @echo "--------------------------------------------------------------" .endfor .endif @@ -2880,7 +2890,8 @@ CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDE # combined with --sysroot. CD2CFLAGS+= -B${XDDESTDIR}/usr/lib # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ .endif Modified: user/jeff/numa/Makefile.libcompat ============================================================================== --- user/jeff/numa/Makefile.libcompat Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/Makefile.libcompat Mon Feb 5 23:14:20 2018 (r328908) @@ -108,7 +108,8 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat # sysroot path which --sysroot does not actually do for headers. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. -.if ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \ +.if defined(X_COMPILER_TYPE) && \ + ${X_COMPILER_TYPE} == gcc && ${X_COMPILER_VERSION} >= 40800 && \ (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ Modified: user/jeff/numa/ObsoleteFiles.inc ============================================================================== --- user/jeff/numa/ObsoleteFiles.inc Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/ObsoleteFiles.inc Mon Feb 5 23:14:20 2018 (r328908) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180201: Obsolete forth files +OLD_FILES+=boot/efi.4th +OLD_FILES+=boot/pcibios.4th + # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: user/jeff/numa/bin/date/date.c ============================================================================== --- user/jeff/numa/bin/date/date.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/date/date.c Mon Feb 5 23:14:20 2018 (r328908) @@ -301,6 +301,7 @@ setthetime(const char *fmt, const char *p, int jflag, /* set the time */ if (nflag || netsettime(tval)) { utx.ut_type = OLD_TIME; + memset(utx.ut_id, 0, sizeof(utx.ut_id)); (void)gettimeofday(&utx.ut_tv, NULL); pututxline(&utx); tv.tv_sec = tval; Modified: user/jeff/numa/bin/dd/dd.c ============================================================================== --- user/jeff/numa/bin/dd/dd.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/dd/dd.c Mon Feb 5 23:14:20 2018 (r328908) @@ -339,6 +339,21 @@ speed_limit(void) } static void +swapbytes(void *v, size_t len) +{ + unsigned char *p = v; + unsigned char t; + + while (len > 1) { + t = p[0]; + p[0] = p[1]; + p[1] = t; + p += 2; + len -= 2; + } +} + +static void dd_in(void) { ssize_t n; @@ -438,7 +453,7 @@ dd_in(void) ++st.swab; --n; } - swab(in.dbp, in.dbp, (size_t)n); + swapbytes(in.dbp, (size_t)n); } in.dbp += in.dbrcnt; Modified: user/jeff/numa/bin/pax/pax.c ============================================================================== --- user/jeff/numa/bin/pax/pax.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/pax/pax.c Mon Feb 5 23:14:20 2018 (r328908) @@ -109,7 +109,7 @@ char *tempbase; /* basename of tempfile to use for mk /* * PAX - Portable Archive Interchange * - * A utility to read, write, and write lists of the members of archive + * A utility to read, write, and write lists of the members of archive * files and copy directory hierarchies. A variety of archive formats * are supported (some are described in POSIX 1003.1 10.1): * @@ -237,7 +237,7 @@ main(int argc, char *argv[]) /* * Keep a reference to cwd, so we can always come back home. */ - cwdfd = open(".", O_RDONLY); + cwdfd = open(".", O_RDONLY | O_CLOEXEC); if (cwdfd < 0) { syswarn(0, errno, "Can't open current working directory."); return(exit_val); @@ -249,7 +249,7 @@ main(int argc, char *argv[]) if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') tmpdir = _PATH_TMP; tdlen = strlen(tmpdir); - while(tdlen > 0 && tmpdir[tdlen - 1] == '/') + while (tdlen > 0 && tmpdir[tdlen - 1] == '/') tdlen--; tempfile = malloc(tdlen + 1 + sizeof(_TFILE_BASE)); if (tempfile == NULL) { @@ -271,7 +271,7 @@ main(int argc, char *argv[]) /* * select a primary operation mode */ - switch(act) { + switch (act) { case EXTRACT: extract(); break; @@ -325,6 +325,25 @@ sig_cleanup(int which_sig) } /* + * setup_sig() + * set a signal to be caught, but only if it isn't being ignored already + */ + +static int +setup_sig(int sig, const struct sigaction *n_hand) +{ + struct sigaction o_hand; + + if (sigaction(sig, NULL, &o_hand) < 0) + return (-1); + + if (o_hand.sa_handler == SIG_IGN) + return (0); + + return (sigaction(sig, n_hand, NULL)); +} + +/* * gen_init() * general setup routines. Not all are required, but they really help * when dealing with a medium to large sized archives. @@ -335,7 +354,6 @@ gen_init(void) { struct rlimit reslimit; struct sigaction n_hand; - struct sigaction o_hand; /* * Really needed to handle large archives. We can run out of memory for @@ -389,34 +407,16 @@ gen_init(void) n_hand.sa_flags = 0; n_hand.sa_handler = sig_cleanup; - if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGHUP, &o_hand, &o_hand) < 0)) + if (setup_sig(SIGHUP, &n_hand) || + setup_sig(SIGTERM, &n_hand) || + setup_sig(SIGINT, &n_hand) || + setup_sig(SIGQUIT, &n_hand) || + setup_sig(SIGXCPU, &n_hand)) goto out; - if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGTERM, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGINT, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) - goto out; - - if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && - (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) - goto out; - n_hand.sa_handler = SIG_IGN; - if ((sigaction(SIGPIPE, &n_hand, &o_hand) < 0) || - (sigaction(SIGXFSZ, &n_hand, &o_hand) < 0)) + if ((sigaction(SIGPIPE, &n_hand, NULL) < 0) || + (sigaction(SIGXFSZ, &n_hand, NULL) < 0)) goto out; return(0); Modified: user/jeff/numa/bin/ps/keyword.c ============================================================================== --- user/jeff/numa/bin/ps/keyword.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/ps/keyword.c Mon Feb 5 23:14:20 2018 (r328908) @@ -122,7 +122,7 @@ static VAR var[] = { {"logname", "", "login", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"lstart", "STARTED", NULL, "start-time", LJUST|USER, lstarted, 0, CHAR, NULL, 0}, - {"lwp", "LWP", NULL, "process-thread-id", 0, kvar, KOFF(ki_tid), UINT, + {"lwp", "LWP", NULL, "thread-id", 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, {"majflt", "MAJFLT", NULL, "major-faults", USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, @@ -204,6 +204,7 @@ static VAR var[] = { {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tid", "", "lwp", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: user/jeff/numa/bin/ps/ps.1 ============================================================================== --- user/jeff/numa/bin/ps/ps.1 Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/ps/ps.1 Mon Feb 5 23:14:20 2018 (r328908) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd January 23, 2018 .Dt PS 1 .Os .Sh NAME @@ -148,12 +148,7 @@ This option is honored only if the UID of the user is Display information about processes which are running with the specified real group IDs. .It Fl H -Show all of the -.Em kernel visible -threads associated with each process. -Depending on the threading package that -is in use, this may show only the process, only the kernel scheduled entities, -or all of the process threads. +Show all of the threads associated with each process. .It Fl h Repeat the information header as often as necessary to guarantee one header per page of information. @@ -588,7 +583,8 @@ login name of user who started the session .It Cm lstart time started .It Cm lwp -process thread-id +thread (light-weight process) ID (alias +.Cm tid ) .It Cm majflt total page faults .It Cm minflt @@ -605,7 +601,7 @@ nice value (alias .It Cm nivcsw total involuntary context switches .It Cm nlwp -number of threads tied to a process +number of threads (light-weight processes) tied to a process .It Cm nsigs total signals taken (alias .Cm nsignals ) Modified: user/jeff/numa/bin/sh/jobs.c ============================================================================== --- user/jeff/numa/bin/sh/jobs.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/bin/sh/jobs.c Mon Feb 5 23:14:20 2018 (r328908) @@ -362,7 +362,7 @@ showjob(struct job *jp, int mode) const char *statestr, *coredump; struct procstat *ps; struct job *j; - int col, curr, i, jobno, prev, procno; + int col, curr, i, jobno, prev, procno, status; char c; procno = (mode == SHOWJOBS_PGIDS) ? 1 : jp->nprocs; @@ -376,11 +376,12 @@ showjob(struct job *jp, int mode) } #endif coredump = ""; - ps = jp->ps + jp->nprocs - 1; + status = jp->ps[jp->nprocs - 1].status; if (jp->state == 0) { statestr = "Running"; #if JOBS } else if (jp->state == JOBSTOPPED) { + ps = jp->ps + jp->nprocs - 1; while (!WIFSTOPPED(ps->status) && ps > jp->ps) ps--; if (WIFSTOPPED(ps->status)) @@ -391,20 +392,20 @@ showjob(struct job *jp, int mode) if (statestr == NULL) statestr = "Suspended"; #endif - } else if (WIFEXITED(ps->status)) { - if (WEXITSTATUS(ps->status) == 0) + } else if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) statestr = "Done"; else { fmtstr(statebuf, sizeof(statebuf), "Done(%d)", - WEXITSTATUS(ps->status)); + WEXITSTATUS(status)); statestr = statebuf; } } else { - i = WTERMSIG(ps->status); + i = WTERMSIG(status); statestr = strsignal(i); if (statestr == NULL) statestr = "Unknown signal"; - if (WCOREDUMP(ps->status)) + if (WCOREDUMP(status)) coredump = " (core dumped)"; } Modified: user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Mon Feb 5 23:14:20 2018 (r328908) @@ -18,6 +18,7 @@ .Nd executes ZFS channel programs .Sh SYNOPSIS .Cm zfs program +.Op Fl n .Op Fl t Ar instruction-limit .Op Fl m Ar memory-limit .Ar pool @@ -45,6 +46,14 @@ will be run on and any attempts to access or modify other pools will cause an error. .Sh OPTIONS .Bl -tag -width "-t" +.It Fl n +Executes a read-only channel program, which runs faster. +The program cannot change on-disk state by calling functions from the +zfs.sync submodule. +The program can be used to gather information such as properties and +determining if changes would succeed (zfs.check.*). +Without this flag, all pending changes must be synced to disk before a +channel program can complete. .It Fl t Ar instruction-limit Execution time limit, in number of Lua instructions to execute. If a channel program executes more than the specified number of instructions, Modified: user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 5 23:14:20 2018 (r328908) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2016 +.Dd December 6, 2017 .Dt ZFS 8 .Os .Sh NAME @@ -287,6 +287,7 @@ .Op Ar snapshot Ns | Ns Ar filesystem .Nm .Cm program +.Op Fl n .Op Fl t Ar timeout .Op Fl m Ar memory_limit .Ar pool script @@ -973,6 +974,10 @@ Please see for more information on these algorithms. .Pp Changing this property affects only newly-written data. +.Pp +Salted checksum algorithms +.Pq Cm edonr , skein +are currently not supported for any filesystem on the boot pools. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | Cm zle | Cm lz4 Controls the compression algorithm used for this dataset. Setting compression to @@ -3294,6 +3299,7 @@ Display the path's inode change time as the first colu .It Xo .Nm .Cm program +.Op Fl n .Op Fl t Ar timeout .Op Fl m Ar memory_limit .Ar pool script @@ -3316,6 +3322,14 @@ For full documentation of the ZFS channel program inte page for .Xr zfs-program 8 . .Bl -tag -width indent +.It Fl n +Executes a read-only channel program, which runs faster. +The program cannot change on-disk state by calling functions from +the zfs.sync submodule. +The program can be used to gather information such as properties and +determining if changes would succeed (zfs.check.*). +Without this flag, all pending changes must be synced to disk before +a channel program can complete. .It Fl t Ar timeout Execution time limit, in milliseconds. If a channel program executes for longer than the provided timeout, it will Modified: user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Feb 5 23:14:20 2018 (r328908) @@ -345,7 +345,7 @@ get_usage(zfs_help_t idx) case HELP_BOOKMARK: return (gettext("\tbookmark \n")); case HELP_CHANNEL_PROGRAM: - return (gettext("\tprogram [-t ] " + return (gettext("\tprogram [-n] [-t ] " "[-m ] " "[lua args...]\n")); } @@ -5636,8 +5636,6 @@ print_holds(boolean_t scripted, boolean_t literal, siz uint64_t val = 0; time_t time; struct tm t; - char sep = scripted ? '\t' : ' '; - size_t sepnum = scripted ? 1 : 2; (void) nvpair_value_uint64(nvp2, &val); if (literal) @@ -5649,8 +5647,13 @@ print_holds(boolean_t scripted, boolean_t literal, siz gettext(STRFTIME_FMT_STR), &t); } - (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname, - sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf); + if (scripted) { + (void) printf("%s\t%s\t%s\n", zname, + tagname, tsbuf); + } else { + (void) printf("%-*s %-*s %s\n", nwidth, + zname, tagwidth, tagname, tsbuf); + } } } } @@ -7131,11 +7134,12 @@ zfs_do_channel_program(int argc, char **argv) nvlist_t *outnvl; uint64_t instrlimit = ZCP_DEFAULT_INSTRLIMIT; uint64_t memlimit = ZCP_DEFAULT_MEMLIMIT; + boolean_t sync_flag = B_TRUE; zpool_handle_t *zhp; /* check options */ while (-1 != - (c = getopt(argc, argv, "t:(instr-limit)m:(memory-limit)"))) { + (c = getopt(argc, argv, "nt:(instr-limit)m:(memory-limit)"))) { switch (c) { case 't': case 'm': { @@ -7173,6 +7177,10 @@ zfs_do_channel_program(int argc, char **argv) } break; } + case 'n': { + sync_flag = B_FALSE; + break; + } case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -7244,8 +7252,13 @@ zfs_do_channel_program(int argc, char **argv) nvlist_t *argnvl = fnvlist_alloc(); fnvlist_add_string_array(argnvl, ZCP_ARG_CLIARGV, argv + 2, argc - 2); - ret = lzc_channel_program(poolname, progbuf, instrlimit, memlimit, - argnvl, &outnvl); + if (sync_flag) { + ret = lzc_channel_program(poolname, progbuf, + instrlimit, memlimit, argnvl, &outnvl); + } else { + ret = lzc_channel_program_nosync(poolname, progbuf, + instrlimit, memlimit, argnvl, &outnvl); + } if (ret != 0) { /* Modified: user/jeff/numa/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 5 23:14:20 2018 (r328908) @@ -441,7 +441,7 @@ add_prop_list(const char *propname, char *propval, nvl * feature@ properties and version should not be specified * at the same time. */ - if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) && + if ((prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname) && nvlist_exists(proplist, vname)) || (prop == ZPOOL_PROP_VERSION && prop_list_contains_feature(proplist))) { Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Mon Feb 5 23:14:20 2018 (r328908) @@ -28,7 +28,7 @@ * Copyright (c) 2013 Martin Matuska. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] - * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2017 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov * Copyright 2017 RackTop Systems. */ @@ -2381,7 +2381,7 @@ zcp_check(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t fnvlist_add_string(argnvl, "dataset", zhp->zfs_name); fnvlist_add_string(argnvl, "property", zfs_prop_to_name(prop)); - error = lzc_channel_program(poolname, program, + error = lzc_channel_program_nosync(poolname, program, 10 * 1000 * 1000, 10 * 1024 * 1024, argnvl, &outnvl); if (error == 0) { @@ -3522,6 +3522,10 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs "pool must be upgraded to set this " "property or value")); return (zfs_error(hdl, EZFS_BADVERSION, errbuf)); + case ERANGE: + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "invalid property value(s) specified")); + return (zfs_error(hdl, EZFS_BADPROP, errbuf)); #ifdef _ILP32 case EOVERFLOW: /* Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 5 23:14:20 2018 (r328908) @@ -50,6 +50,7 @@ #include "zfeature_common.h" static int read_efi_label(nvlist_t *config, diskaddr_t *sb); +static boolean_t zpool_vdev_is_interior(const char *name); #define BACKUP_SLICE "s2" @@ -444,7 +445,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char const char *propname = nvpair_name(elem); prop = zpool_name_to_prop(propname); - if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { + if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) { int err; char *fname = strchr(propname, '@') + 1; @@ -483,7 +484,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char /* * Make sure this property is valid and applies to this type. */ - if (prop == ZPROP_INVAL) { + if (prop == ZPOOL_PROP_INVAL) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid property '%s'"), propname); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); @@ -2065,10 +2066,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, bo break; } - verify(strncmp(type, VDEV_TYPE_RAIDZ, - strlen(VDEV_TYPE_RAIDZ)) == 0 || - strncmp(type, VDEV_TYPE_MIRROR, - strlen(VDEV_TYPE_MIRROR)) == 0); + verify(zpool_vdev_is_interior(type)); verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_ID, &id) == 0); @@ -2175,10 +2173,13 @@ zpool_find_vdev_by_physpath(zpool_handle_t *zhp, const /* * Determine if we have an "interior" top-level vdev (i.e mirror/raidz). */ -boolean_t +static boolean_t zpool_vdev_is_interior(const char *name) { if (strncmp(name, VDEV_TYPE_RAIDZ, strlen(VDEV_TYPE_RAIDZ)) == 0 || + strncmp(name, VDEV_TYPE_SPARE, strlen(VDEV_TYPE_SPARE)) == 0 || + strncmp(name, + VDEV_TYPE_REPLACING, strlen(VDEV_TYPE_REPLACING)) == 0 || strncmp(name, VDEV_TYPE_MIRROR, strlen(VDEV_TYPE_MIRROR)) == 0) return (B_TRUE); return (B_FALSE); @@ -2419,6 +2420,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *pat { zfs_cmd_t zc = { 0 }; char msg[1024]; + char *pathname; nvlist_t *tgt; boolean_t avail_spare, l2cache, islog; libzfs_handle_t *hdl = zhp->zpool_hdl; @@ -2441,15 +2443,13 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *pat if (avail_spare) return (zfs_error(hdl, EZFS_ISSPARE, msg)); - if (flags & ZFS_ONLINE_EXPAND || - zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) { - char *pathname = NULL; + if ((flags & ZFS_ONLINE_EXPAND || + zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) && + nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &pathname) == 0) { uint64_t wholedisk = 0; (void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk); - verify(nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, - &pathname) == 0); /* * XXX - L2ARC 1.0 devices can't support expansion. Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Mon Feb 5 23:14:20 2018 (r328908) @@ -918,6 +918,25 @@ lzc_destroy_bookmarks(nvlist_t *bmarks, nvlist_t **err return (error); } +static int +lzc_channel_program_impl(const char *pool, const char *program, boolean_t sync, + uint64_t instrlimit, uint64_t memlimit, nvlist_t *argnvl, nvlist_t **outnvl) +{ + int error; + nvlist_t *args; + + args = fnvlist_alloc(); + fnvlist_add_string(args, ZCP_ARG_PROGRAM, program); + fnvlist_add_nvlist(args, ZCP_ARG_ARGLIST, argnvl); + fnvlist_add_boolean_value(args, ZCP_ARG_SYNC, sync); + fnvlist_add_uint64(args, ZCP_ARG_INSTRLIMIT, instrlimit); + fnvlist_add_uint64(args, ZCP_ARG_MEMLIMIT, memlimit); + error = lzc_ioctl(ZFS_IOC_CHANNEL_PROGRAM, pool, args, outnvl); + fnvlist_free(args); + + return (error); +} + /* * Executes a channel program. * @@ -955,16 +974,26 @@ int lzc_channel_program(const char *pool, const char *program, uint64_t instrlimit, uint64_t memlimit, nvlist_t *argnvl, nvlist_t **outnvl) { - int error; - nvlist_t *args; + return (lzc_channel_program_impl(pool, program, B_TRUE, instrlimit, + memlimit, argnvl, outnvl)); +} - args = fnvlist_alloc(); - fnvlist_add_string(args, ZCP_ARG_PROGRAM, program); - fnvlist_add_nvlist(args, ZCP_ARG_ARGLIST, argnvl); - fnvlist_add_uint64(args, ZCP_ARG_INSTRLIMIT, instrlimit); - fnvlist_add_uint64(args, ZCP_ARG_MEMLIMIT, memlimit); - error = lzc_ioctl(ZFS_IOC_CHANNEL_PROGRAM, pool, args, outnvl); - fnvlist_free(args); - - return (error); +/* + * Executes a read-only channel program. + * + * A read-only channel program works programmatically the same way as a + * normal channel program executed with lzc_channel_program(). The only + * difference is it runs exclusively in open-context and therefore can + * return faster. The downside to that, is that the program cannot change + * on-disk state by calling functions from the zfs.sync submodule. + * + * The return values of this function (and their meaning) are exactly the + * same as the ones described in lzc_channel_program(). + */ +int +lzc_channel_program_nosync(const char *pool, const char *program, + uint64_t timeout, uint64_t memlimit, nvlist_t *argnvl, nvlist_t **outnvl) +{ + return (lzc_channel_program_impl(pool, program, B_FALSE, timeout, + memlimit, argnvl, outnvl)); } Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Mon Feb 5 23:14:20 2018 (r328908) @@ -86,8 +86,10 @@ boolean_t lzc_exists(const char *); int lzc_rollback(const char *, char *, int); int lzc_rollback_to(const char *, const char *); -int lzc_channel_program(const char *, const char *, uint64_t, uint64_t, - nvlist_t *, nvlist_t **); +int lzc_channel_program(const char *, const char *, uint64_t, + uint64_t, nvlist_t *, nvlist_t **); +int lzc_channel_program_nosync(const char *, const char *, uint64_t, + uint64_t, nvlist_t *, nvlist_t **); #ifdef __cplusplus } Modified: user/jeff/numa/cddl/lib/libdtrace/tcp.d ============================================================================== --- user/jeff/numa/cddl/lib/libdtrace/tcp.d Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/lib/libdtrace/tcp.d Mon Feb 5 23:14:20 2018 (r328908) @@ -260,7 +260,7 @@ translator tcpinfoh_t < struct tcphdr *p > { tcp_ack = p == NULL ? -1 : p->th_ack; tcp_offset = p == NULL ? -1 : (p->th_off >> 2); tcp_flags = p == NULL ? 0 : p->th_flags; - tcp_window = p == NULL ? 0 : (p->th_win); + tcp_window = p == NULL ? 0 : p->th_win; tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum); tcp_urgent = p == NULL ? 0 : p->th_urp; tcp_hdr = (struct tcphdr *)p; Modified: user/jeff/numa/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- user/jeff/numa/cddl/usr.sbin/zfsd/case_file.cc Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/cddl/usr.sbin/zfsd/case_file.cc Mon Feb 5 23:14:20 2018 (r328908) @@ -442,10 +442,38 @@ CaseFile::ReEvaluate(const ZfsEvent &event) return (consumed || closed); } +/* Find a Vdev containing the vdev with the given GUID */ +static nvlist_t* +find_parent(nvlist_t *pool_config, nvlist_t *config, DevdCtl::Guid child_guid) +{ + nvlist_t **vdevChildren; + int error; + unsigned ch, numChildren; + error = nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, + &vdevChildren, &numChildren); + + if (error != 0 || numChildren == 0) + return (NULL); + + for (ch = 0; ch < numChildren; ch++) { + nvlist *result; + Vdev vdev(pool_config, vdevChildren[ch]); + + if (vdev.GUID() == child_guid) + return (config); + + result = find_parent(pool_config, vdevChildren[ch], child_guid); + if (result != NULL) + return (result); + } + + return (NULL); +} + bool CaseFile::ActivateSpare() { - nvlist_t *config, *nvroot; + nvlist_t *config, *nvroot, *parent_config; nvlist_t **spares; char *devPath, *vdev_type; const char *poolname; @@ -472,6 +500,22 @@ CaseFile::ActivateSpare() { "tree for pool %s", poolname); return (false); } + + parent_config = find_parent(config, nvroot, m_vdevGUID); + if (parent_config != NULL) { + char *parent_type; + + /* + * Don't activate spares for members of a "replacing" vdev. + * They're already dealt with. Sparing them will just drag out + * the resilver process. + */ + error = nvlist_lookup_string(parent_config, + ZPOOL_CONFIG_TYPE, &parent_type); + if (error == 0 && strcmp(parent_type, VDEV_TYPE_REPLACING) == 0) + return (false); + } + nspares = 0; nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES, &spares, &nspares); Modified: user/jeff/numa/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- user/jeff/numa/contrib/blacklist/libexec/blacklistd-helper Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/blacklist/libexec/blacklistd-helper Mon Feb 5 23:14:20 2018 (r328908) @@ -80,8 +80,8 @@ add) echo "block in quick $proto from to any $port" | \ /sbin/pfctl -a "$2/$6" -f - # insert $ip/$mask into per-protocol/port anchored table - /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \ - echo OK + /sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \ + /sbin/pfctl -q -k $addr && echo OK ;; esac ;; @@ -101,7 +101,7 @@ rem) /sbin/npfctl rule "$2" rem-id "$7" ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ + /sbin/pfctl -qa "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ echo OK ;; esac @@ -118,7 +118,13 @@ flush) /sbin/npfctl rule "$2" flush ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK + # dynamically determine which anchors exist + anchors=$(/sbin/pfctl -a $2 -s Anchors) + for anchor in $anchors; do + /sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush + /sbin/pfctl -a $anchor -F rules + done + echo OK ;; esac ;; Modified: user/jeff/numa/contrib/compiler-rt/lib/builtins/clear_cache.c ============================================================================== --- user/jeff/numa/contrib/compiler-rt/lib/builtins/clear_cache.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/compiler-rt/lib/builtins/clear_cache.c Mon Feb 5 23:14:20 2018 (r328908) @@ -33,6 +33,11 @@ uintptr_t GetCurrentProcess(void); #include #endif +#if defined(__OpenBSD__) && defined(__mips__) + #include + #include +#endif + #if defined(__linux__) && defined(__mips__) #include #include @@ -142,6 +147,8 @@ void __clear_cache(void *start, void *end) { #else syscall(__NR_cacheflush, start, (end_int - start_int), BCACHE); #endif +#elif defined(__mips__) && defined(__OpenBSD__) + cacheflush(start, (uintptr_t)end - (uintptr_t)start, BCACHE); #elif defined(__aarch64__) && !defined(__APPLE__) uint64_t xstart = (uint64_t)(uintptr_t) start; uint64_t xend = (uint64_t)(uintptr_t) end; @@ -156,12 +163,14 @@ void __clear_cache(void *start, void *end) { * uintptr_t in case this runs in an IPL32 environment. */ const size_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15); - for (addr = xstart; addr < xend; addr += dcache_line_size) + for (addr = xstart & ~(dcache_line_size - 1); addr < xend; + addr += dcache_line_size) __asm __volatile("dc cvau, %0" :: "r"(addr)); __asm __volatile("dsb ish"); const size_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15); - for (addr = xstart; addr < xend; addr += icache_line_size) + for (addr = xstart & ~(icache_line_size - 1); addr < xend; + addr += icache_line_size) __asm __volatile("ic ivau, %0" :: "r"(addr)); __asm __volatile("isb sy"); #elif defined (__powerpc64__) Modified: user/jeff/numa/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h ============================================================================== --- user/jeff/numa/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/compiler-rt/lib/tsan/rtl/tsan_platform.h Mon Feb 5 23:14:20 2018 (r328908) @@ -79,25 +79,27 @@ struct Mapping { #define TSAN_MID_APP_RANGE 1 #elif defined(__mips64) /* -C/C++ on linux/mips64 -0100 0000 00 - 0200 0000 00: main binary -0200 0000 00 - 1400 0000 00: - -1400 0000 00 - 2400 0000 00: shadow -2400 0000 00 - 3000 0000 00: - -3000 0000 00 - 4000 0000 00: metainfo (memory blocks and sync objects) -4000 0000 00 - 6000 0000 00: - -6000 0000 00 - 6200 0000 00: traces -6200 0000 00 - fe00 0000 00: - -fe00 0000 00 - ff00 0000 00: heap -ff00 0000 00 - ff80 0000 00: - -ff80 0000 00 - ffff ffff ff: modules and main thread stack +C/C++ on linux/mips64 (40-bit VMA) +0000 0000 00 - 0100 0000 00: - (4 GB) +0100 0000 00 - 0200 0000 00: main binary (4 GB) +0200 0000 00 - 2000 0000 00: - (120 GB) +2000 0000 00 - 4000 0000 00: shadow (128 GB) +4000 0000 00 - 5000 0000 00: metainfo (memory blocks and sync objects) (64 GB) +5000 0000 00 - aa00 0000 00: - (360 GB) +aa00 0000 00 - ab00 0000 00: main binary (PIE) (4 GB) +ab00 0000 00 - b000 0000 00: - (20 GB) +b000 0000 00 - b200 0000 00: traces (8 GB) +b200 0000 00 - fe00 0000 00: - (304 GB) +fe00 0000 00 - ff00 0000 00: heap (4 GB) +ff00 0000 00 - ff80 0000 00: - (2 GB) +ff80 0000 00 - ffff ffff ff: modules and main thread stack (<2 GB) */ struct Mapping { static const uptr kMetaShadowBeg = 0x4000000000ull; static const uptr kMetaShadowEnd = 0x5000000000ull; static const uptr kTraceMemBeg = 0xb000000000ull; static const uptr kTraceMemEnd = 0xb200000000ull; - static const uptr kShadowBeg = 0x2400000000ull; + static const uptr kShadowBeg = 0x2000000000ull; static const uptr kShadowEnd = 0x4000000000ull; static const uptr kHeapMemBeg = 0xfe00000000ull; static const uptr kHeapMemEnd = 0xff00000000ull; Modified: user/jeff/numa/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- user/jeff/numa/contrib/jemalloc/FREEBSD-diffs Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/jemalloc/FREEBSD-diffs Mon Feb 5 23:14:20 2018 (r328908) @@ -153,7 +153,7 @@ index 00000000..355b565c + * each supported architecture. + */ +#undef JEMALLOC_TLS_MODEL -+#undef STATIC_PAGE_SHIFT ++#undef LG_PAGE +#undef LG_VADDR +#undef LG_SIZEOF_PTR +#undef LG_SIZEOF_INT @@ -212,7 +212,7 @@ index 00000000..355b565c +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif + -+#define STATIC_PAGE_SHIFT PAGE_SHIFT ++#define LG_PAGE PAGE_SHIFT +#define LG_SIZEOF_INT 2 +#define LG_SIZEOF_LONG LG_SIZEOF_PTR +#define LG_SIZEOF_INTMAX_T 3 Modified: user/jeff/numa/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- user/jeff/numa/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Feb 5 23:14:20 2018 (r328908) @@ -17,7 +17,7 @@ * each supported architecture. */ #undef JEMALLOC_TLS_MODEL -#undef STATIC_PAGE_SHIFT +#undef LG_PAGE #undef LG_VADDR #undef LG_SIZEOF_PTR #undef LG_SIZEOF_INT @@ -76,7 +76,7 @@ # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_PAGE PAGE_SHIFT #define LG_SIZEOF_INT 2 #define LG_SIZEOF_LONG LG_SIZEOF_PTR #define LG_SIZEOF_INTMAX_T 3 Modified: user/jeff/numa/contrib/libarchive/cat/bsdcat.c ============================================================================== --- user/jeff/numa/contrib/libarchive/cat/bsdcat.c Mon Feb 5 23:04:39 2018 (r328907) +++ user/jeff/numa/contrib/libarchive/cat/bsdcat.c Mon Feb 5 23:14:20 2018 (r328908) @@ -70,6 +70,12 @@ version(void) void bsdcat_next(void) { + if (a != NULL) { + if (archive_read_close(a) != ARCHIVE_OK) + bsdcat_print_error(); + archive_read_free(a); + } + a = archive_read_new(); archive_read_support_filter_all(a); archive_read_support_format_empty(a); @@ -100,8 +106,10 @@ bsdcat_read_to_stdout(const char* filename) ; else if (archive_read_data_into_fd(a, 1) != ARCHIVE_OK) bsdcat_print_error(); - if (archive_read_free(a) != ARCHIVE_OK) + if (archive_read_close(a) != ARCHIVE_OK) bsdcat_print_error(); + archive_read_free(a); + a = NULL; } int @@ -135,15 +143,14 @@ main(int argc, char **argv) if (*bsdcat->argv == NULL) { bsdcat_current_path = ""; bsdcat_read_to_stdout(NULL); - } else + } else { while (*bsdcat->argv) { bsdcat_current_path = *bsdcat->argv++; bsdcat_read_to_stdout(bsdcat_current_path); bsdcat_next(); } - - if (a != NULL) - archive_read_free(a); + archive_read_free(a); /* Help valgrind & friends */ + } exit(exit_status); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Feb 6 02:13:44 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED9AEE6CAC for ; Tue, 6 Feb 2018 02:13:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9363A6EC06; Tue, 6 Feb 2018 02:13:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DED611711; Tue, 6 Feb 2018 02:13:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w162Diql036926; Tue, 6 Feb 2018 02:13:44 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w162DiV9036925; Tue, 6 Feb 2018 02:13:44 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802060213.w162DiV9036925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Feb 2018 02:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328915 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 328915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 02:13:45 -0000 Author: jeff Date: Tue Feb 6 02:13:44 2018 New Revision: 328915 URL: https://svnweb.freebsd.org/changeset/base/328915 Log: Fix a type issue for 32bit archs. Modified: user/jeff/numa/sys/kern/vfs_bio.c Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Tue Feb 6 00:19:46 2018 (r328914) +++ user/jeff/numa/sys/kern/vfs_bio.c Tue Feb 6 02:13:44 2018 (r328915) @@ -1587,8 +1587,8 @@ buf_recycle(struct bufdomain *bd, bool kva) ("buf_recycle: inconsistent queue %d bp %p", bp->b_qindex, bp)); KASSERT(bp->b_domain == BD_DOMAIN(bd), - ("getnewbuf: queue domain %d doesn't match request %ld", - bp->b_domain, BD_DOMAIN(bd))); + ("getnewbuf: queue domain %d doesn't match request %d", + bp->b_domain, (int)BD_DOMAIN(bd))); /* * NOTE: nbp is now entirely invalid. We can only restart * the scan from this point on. From owner-svn-src-user@freebsd.org Tue Feb 6 22:52:55 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC224F0F6A4 for ; Tue, 6 Feb 2018 22:52:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 68BAD87780; Tue, 6 Feb 2018 22:52:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w16Mqrct002435 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 14:52:53 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16MqrcT002434; Tue, 6 Feb 2018 14:52:53 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 14:52:53 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r328759 - user/jeff/numa/sys/vm Message-ID: <20180206225253.GD1063@FreeBSD.org> References: <201802012347.w11NlpZY056331@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802012347.w11NlpZY056331@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2018 22:52:56 -0000 Jeff, On Thu, Feb 01, 2018 at 11:47:51PM +0000, Jeff Roberson wrote: J> Author: jeff J> Date: Thu Feb 1 23:47:51 2018 J> New Revision: 328759 J> URL: https://svnweb.freebsd.org/changeset/base/328759 J> J> Log: J> Implement another variant of per-cpu free page caching derived from J> markj's patch. At Netflix we have improved this a tiny bit. We call vm_page_init_cache_zones() right after uma_startup(), so in the allocation path we don't need to check that zone already exists. For the per-domain cache zones, I moved uma_zcreate into vm_domain_init(). Works the same way. -- Gleb Smirnoff From owner-svn-src-user@freebsd.org Wed Feb 7 00:50:45 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13FC7F18166 for ; Wed, 7 Feb 2018 00:50:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B96106D543; Wed, 7 Feb 2018 00:50:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3FDF1F9E4; Wed, 7 Feb 2018 00:50:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w170oivX017505; Wed, 7 Feb 2018 00:50:44 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w170oef5015293; Wed, 7 Feb 2018 00:50:40 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802070050.w170oef5015293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 7 Feb 2018 00:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328962 - in user/jeff/numa: . bin/sh contrib/gcc/config/mips contrib/gdb/gdb/tui contrib/libreadline etc etc/rc.d gnu/lib gnu/lib/libreadline gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/us... X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in user/jeff/numa: . bin/sh contrib/gcc/config/mips contrib/gdb/gdb/tui contrib/libreadline etc etc/rc.d gnu/lib gnu/lib/libreadline gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gdbtui gnu/usr.... X-SVN-Commit-Revision: 328962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 00:50:45 -0000 Author: jeff Date: Wed Feb 7 00:50:40 2018 New Revision: 328962 URL: https://svnweb.freebsd.org/changeset/base/328962 Log: Merge from head. Added: user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c - copied unchanged from r328957, head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h - copied unchanged from r328957, head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h user/jeff/numa/sys/i386/i386/sigtramp.s - copied unchanged from r328957, head/sys/i386/i386/sigtramp.s Deleted: user/jeff/numa/contrib/libreadline/ user/jeff/numa/gnu/lib/libreadline/ user/jeff/numa/gnu/usr.bin/gdb/gdbtui/ user/jeff/numa/sys/dev/bwn/if_bwn_bhnd.c user/jeff/numa/sys/dev/bwn/if_bwn_chipid.h user/jeff/numa/sys/dev/bwn/if_bwn_siba.c user/jeff/numa/sys/dev/bwn/if_bwn_siba.h user/jeff/numa/sys/dev/bwn/if_bwn_siba_compat.c user/jeff/numa/sys/dev/bwn/if_bwn_siba_compat.h user/jeff/numa/sys/dev/siba/ user/jeff/numa/sys/modules/bwn_pci/ user/jeff/numa/sys/modules/siba_bwn/ Modified: user/jeff/numa/Makefile user/jeff/numa/Makefile.inc1 user/jeff/numa/ObsoleteFiles.inc user/jeff/numa/bin/sh/mkbuiltins user/jeff/numa/bin/sh/mktokens user/jeff/numa/contrib/gcc/config/mips/mips.h user/jeff/numa/contrib/gdb/gdb/tui/tui-io.c user/jeff/numa/etc/rc user/jeff/numa/etc/rc.d/cleanvar user/jeff/numa/gnu/lib/Makefile user/jeff/numa/gnu/usr.bin/gdb/Makefile user/jeff/numa/gnu/usr.bin/gdb/Makefile.inc user/jeff/numa/gnu/usr.bin/gdb/gdb/Makefile user/jeff/numa/gnu/usr.bin/gdb/kgdb/Makefile user/jeff/numa/sbin/etherswitchcfg/etherswitchcfg.c user/jeff/numa/share/man/man4/bwn.4 user/jeff/numa/share/man/man7/arch.7 user/jeff/numa/share/man/man8/rc.subr.8 user/jeff/numa/share/man/man9/bus_map_resource.9 user/jeff/numa/share/mk/src.libnames.mk user/jeff/numa/stand/common/load_elf_obj.c user/jeff/numa/sys/cam/ata/ata_da.c user/jeff/numa/sys/cam/ata/ata_pmp.c user/jeff/numa/sys/cam/ata/ata_xpt.c user/jeff/numa/sys/cam/cam_periph.c user/jeff/numa/sys/cam/cam_periph.h user/jeff/numa/sys/cam/ctl/scsi_ctl.c user/jeff/numa/sys/cam/mmc/mmc_da.c user/jeff/numa/sys/cam/mmc/mmc_xpt.c user/jeff/numa/sys/cam/nvme/nvme_da.c user/jeff/numa/sys/cam/nvme/nvme_xpt.c user/jeff/numa/sys/cam/scsi/scsi_cd.c user/jeff/numa/sys/cam/scsi/scsi_da.c user/jeff/numa/sys/cam/scsi/scsi_enc.c user/jeff/numa/sys/cam/scsi/scsi_pass.c user/jeff/numa/sys/cam/scsi/scsi_pt.c user/jeff/numa/sys/cam/scsi/scsi_sa.c user/jeff/numa/sys/cam/scsi/scsi_sg.c user/jeff/numa/sys/cam/scsi/scsi_xpt.c user/jeff/numa/sys/conf/files user/jeff/numa/sys/conf/files.i386 user/jeff/numa/sys/dev/bhnd/bhnd_ids.h user/jeff/numa/sys/dev/bwn/if_bwn.c user/jeff/numa/sys/dev/bwn/if_bwn_misc.h user/jeff/numa/sys/dev/bwn/if_bwn_pci.c user/jeff/numa/sys/dev/bwn/if_bwn_phy_common.c user/jeff/numa/sys/dev/bwn/if_bwn_phy_common.h user/jeff/numa/sys/dev/bwn/if_bwn_phy_g.c user/jeff/numa/sys/dev/bwn/if_bwn_phy_lp.c user/jeff/numa/sys/dev/bwn/if_bwn_phy_n.c user/jeff/numa/sys/dev/bwn/if_bwn_util.c user/jeff/numa/sys/dev/bwn/if_bwnreg.h user/jeff/numa/sys/dev/bwn/if_bwnvar.h user/jeff/numa/sys/dev/etherswitch/arswitch/arswitch.c user/jeff/numa/sys/dev/etherswitch/arswitch/arswitchreg.h user/jeff/numa/sys/dev/etherswitch/arswitch/arswitchvar.h user/jeff/numa/sys/dev/etherswitch/etherswitch.h user/jeff/numa/sys/dev/mpr/mpr.c user/jeff/numa/sys/dev/mpr/mpr_sas.c user/jeff/numa/sys/dev/mpr/mpr_user.c user/jeff/numa/sys/dev/mpr/mprvar.h user/jeff/numa/sys/dev/mps/mps.c user/jeff/numa/sys/dev/mps/mps_sas.c user/jeff/numa/sys/dev/mps/mps_user.c user/jeff/numa/sys/dev/mps/mpsvar.h user/jeff/numa/sys/fs/ext2fs/ext2_lookup.c user/jeff/numa/sys/fs/tmpfs/tmpfs_subr.c user/jeff/numa/sys/geom/mirror/g_mirror.c user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.h user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c user/jeff/numa/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c user/jeff/numa/sys/i386/i386/locore.s user/jeff/numa/sys/kern/imgact_elf.c user/jeff/numa/sys/kern/kern_malloc.c user/jeff/numa/sys/kern/link_elf_obj.c user/jeff/numa/sys/kern/subr_clock.c user/jeff/numa/sys/kern/subr_fattime.c user/jeff/numa/sys/kern/subr_vmem.c user/jeff/numa/sys/kern/vfs_bio.c user/jeff/numa/sys/mips/mips/machdep.c user/jeff/numa/sys/modules/Makefile user/jeff/numa/sys/modules/bwn/Makefile user/jeff/numa/sys/modules/dtb/allwinner/Makefile user/jeff/numa/sys/sys/bus_dma.h user/jeff/numa/sys/sys/clock.h user/jeff/numa/sys/ufs/ffs/ffs_alloc.c user/jeff/numa/sys/ufs/ffs/ffs_vfsops.c user/jeff/numa/sys/ufs/ufs/ufs_vnops.c user/jeff/numa/sys/vm/uma.h user/jeff/numa/sys/vm/uma_core.c user/jeff/numa/sys/vm/uma_int.h user/jeff/numa/sys/vm/vm_init.c user/jeff/numa/sys/vm/vm_page.c user/jeff/numa/sys/vm/vm_page.h user/jeff/numa/sys/vm/vm_radix.c user/jeff/numa/targets/pseudo/userland/gnu/Makefile.depend user/jeff/numa/tools/build/mk/OptionalObsoleteFiles.inc user/jeff/numa/usr.bin/find/Makefile user/jeff/numa/usr.bin/find/find.h user/jeff/numa/usr.bin/find/function.c user/jeff/numa/usr.bin/find/ls.c user/jeff/numa/usr.bin/find/operator.c user/jeff/numa/usr.bin/find/option.c Directory Properties: user/jeff/numa/ (props changed) user/jeff/numa/contrib/gcc/ (props changed) user/jeff/numa/contrib/gdb/ (props changed) user/jeff/numa/gnu/lib/ (props changed) user/jeff/numa/gnu/usr.bin/gdb/ (props changed) Modified: user/jeff/numa/Makefile ============================================================================== --- user/jeff/numa/Makefile Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/Makefile Wed Feb 7 00:50:40 2018 (r328962) @@ -352,7 +352,7 @@ _guard: .PHONY @false STARTTIME!= LC_ALL=C date -CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo +CHECK_TIME!= cmp=`mktemp`; find ${.CURDIR}/sys/sys/param.h -newer "$$cmp" && rm "$$cmp"; echo .if !empty(CHECK_TIME) .error check your date/time: ${STARTTIME} .endif Modified: user/jeff/numa/Makefile.inc1 ============================================================================== --- user/jeff/numa/Makefile.inc1 Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/Makefile.inc1 Wed Feb 7 00:50:40 2018 (r328962) @@ -463,7 +463,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} # when in the middle of installing over this system. # .if make(distributeworld) || make(installworld) || make(stageworld) -INSTALLTMP!= /usr/bin/mktemp -d -u -t install +INSTALLTMP!= mktemp -d -u -t install .endif .if make(stagekernel) || make(distributekernel) Modified: user/jeff/numa/ObsoleteFiles.inc ============================================================================== --- user/jeff/numa/ObsoleteFiles.inc Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/ObsoleteFiles.inc Wed Feb 7 00:50:40 2018 (r328962) @@ -38,10 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180206: remove gdbtui +OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files OLD_FILES+=boot/efi.4th OLD_FILES+=boot/pcibios.4th - # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: user/jeff/numa/bin/sh/mkbuiltins ============================================================================== --- user/jeff/numa/bin/sh/mkbuiltins Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/bin/sh/mkbuiltins Wed Feb 7 00:50:40 2018 (r328962) @@ -34,7 +34,7 @@ # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 # $FreeBSD$ -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 Modified: user/jeff/numa/bin/sh/mktokens ============================================================================== --- user/jeff/numa/bin/sh/mktokens Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/bin/sh/mktokens Wed Feb 7 00:50:40 2018 (r328962) @@ -38,7 +38,7 @@ # token marks the end of a list. The third column is the name to print in # error messages. -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` cat > $temp <<\! TEOF 1 end of file TNL 0 newline Modified: user/jeff/numa/contrib/gcc/config/mips/mips.h ============================================================================== --- user/jeff/numa/contrib/gcc/config/mips/mips.h Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/contrib/gcc/config/mips/mips.h Wed Feb 7 00:50:40 2018 (r328962) @@ -2721,6 +2721,7 @@ while (0) nop\n\ 1: .cpload $31\n\ .set reorder\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif /* Switch to #elif when we're no longer limited by K&R C. */ @@ -2733,6 +2734,7 @@ while (0) nop\n\ 1: .set reorder\n\ .cpsetup $31, $2, 1b\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif Modified: user/jeff/numa/contrib/gdb/gdb/tui/tui-io.c ============================================================================== --- user/jeff/numa/contrib/gdb/gdb/tui/tui-io.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/contrib/gdb/gdb/tui/tui-io.c Wed Feb 7 00:50:40 2018 (r328962) @@ -397,7 +397,7 @@ static void tui_rl_display_match_list (char **matches, int len, int max) { typedef int QSFUNC (const void *, const void *); - extern int _rl_qsort_string_compare (const void*, const void*); + extern int _rl_qsort_string_compare (char **, char **); extern int _rl_print_completions_horizontally; int count, limit, printed_len; Modified: user/jeff/numa/etc/rc ============================================================================== --- user/jeff/numa/etc/rc Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/etc/rc Wed Feb 7 00:50:40 2018 (r328962) @@ -141,10 +141,10 @@ if [ -e ${firstboot_sentinel} ]; then if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo '' Modified: user/jeff/numa/etc/rc.d/cleanvar ============================================================================== --- user/jeff/numa/etc/rc.d/cleanvar Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/etc/rc.d/cleanvar Wed Feb 7 00:50:40 2018 (r328962) @@ -19,34 +19,6 @@ stop_cmd=":" extra_commands="reload" reload_cmd="${name}_start" -purgedir() -{ - local dir file - - if [ $# -eq 0 ]; then - purgedir . - else - for dir - do - ( - cd "$dir" && for file in .* * - do - # Skip over logging sockets - [ -S "$file" -a "$file" = "log" ] && continue - [ -S "$file" -a "$file" = "logpriv" ] && continue - [ ."$file" = .. -o ."$file" = ... ] && continue - if [ -d "$file" -a ! -L "$file" ] - then - purgedir "$file" - else - rm -f -- "$file" - fi - done - ) - done - fi -} - cleanvar_prestart() { # These files must be removed only the first time this script is run @@ -58,14 +30,17 @@ cleanvar_prestart() cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run + # Skip over logging sockets + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock + find /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi - rm -rf /var/spool/uucp/.Temp/* + if [ -d /var/spool/uucp/.Temp ]; then + find /var/spool/uucp/.Temp -delete + fi } load_rc_config $name Modified: user/jeff/numa/gnu/lib/Makefile ============================================================================== --- user/jeff/numa/gnu/lib/Makefile Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/gnu/lib/Makefile Wed Feb 7 00:50:40 2018 (r328962) @@ -7,7 +7,6 @@ SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests -SUBDIR.${MK_GDB}+= libreadline .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" Modified: user/jeff/numa/gnu/usr.bin/gdb/Makefile ============================================================================== --- user/jeff/numa/gnu/usr.bin/gdb/Makefile Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/gnu/usr.bin/gdb/Makefile Wed Feb 7 00:50:40 2018 (r328962) @@ -5,8 +5,6 @@ SUBDIR= libgdb gdb kgdb .if ${MK_GDB_LIBEXEC} == "no" -SUBDIR+= gdbtui - .if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif Modified: user/jeff/numa/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- user/jeff/numa/gnu/usr.bin/gdb/Makefile.inc Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/gnu/usr.bin/gdb/Makefile.inc Wed Feb 7 00:50:40 2018 (r328962) @@ -13,11 +13,9 @@ BMAKE_BU= ${BMAKE_ROOT}/binutils CNTRB_BU= ${SRCTOP}/contrib/binutils CNTRB_GDB= ${SRCTOP}/contrib/gdb -CNTRB_RL= ${SRCTOP}/contrib/libreadline OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb -OBJ_RL= ${OBJTOP}/gnu/lib/libreadline/readline # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... @@ -37,7 +35,7 @@ GDB_CROSS_DEBUGGER= .PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \ ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} -CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} @@ -47,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${OBJ_RL:H} +CFLAGS+= -I${SRCTOP}/lib/libedit/edit GENSRCS+= nm.h tm.h Modified: user/jeff/numa/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- user/jeff/numa/gnu/usr.bin/gdb/gdb/Makefile Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/gnu/usr.bin/gdb/gdb/Makefile Wed Feb 7 00:50:40 2018 (r328962) @@ -13,7 +13,7 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex +LIBADD+= m edit ncursesw gnuregex .include CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: user/jeff/numa/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- user/jeff/numa/gnu/usr.bin/gdb/kgdb/Makefile Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/gnu/usr.bin/gdb/kgdb/Makefile Wed Feb 7 00:50:40 2018 (r328962) @@ -10,6 +10,6 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex kvm +LIBADD+= m edit ncursesw gnuregex kvm .include Modified: user/jeff/numa/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- user/jeff/numa/sbin/etherswitchcfg/etherswitchcfg.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sbin/etherswitchcfg/etherswitchcfg.c Wed Feb 7 00:50:40 2018 (r328962) @@ -556,6 +556,13 @@ print_config(struct cfg *cfg) printf("none\n"); } } + + /* Print switch MAC address. */ + if (cfg->conf.cmd & ETHERSWITCH_CONF_SWITCH_MACADDR) { + printf("%s: Switch MAC address: %s\n", + c, + ether_ntoa(&cfg->conf.switch_macaddr)); + } } static void Modified: user/jeff/numa/share/man/man4/bwn.4 ============================================================================== --- user/jeff/numa/share/man/man4/bwn.4 Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/share/man/man4/bwn.4 Wed Feb 7 00:50:40 2018 (r328962) @@ -24,26 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2015 +.Dd December 16, 2017 .Dt BWN 4 .Os .Sh NAME .Nm bwn -.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver +.Nd Broadcom BCM43xx SoftMAC IEEE 802.11 wireless network driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: +To compile this driver into the kernel, add the following lines to the kernel +configuration file: .Bd -ragged -offset indent -.Cd "device siba_bwn" .Cd "device bwn" +.Cd "device bhnd" +.Cd "device bhndb" +.Cd "device bhndb_pci" +.Cd "device bcma" +.Cd "device siba" +.Cd "device gpio" .Cd "device wlan" .Cd "device wlan_amrr" .Cd "device firmware" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +To load the driver as a module at boot, add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent if_bwn_load="YES" @@ -122,9 +125,6 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.bwn.msi_disable -This tunable disables MSI support on the hardware. -The default value is 0. .It Va hw.bwn.usedma This tunable enables DMA operations on the hardware. If the value is 0, PIO mode would be used. @@ -132,10 +132,14 @@ The default value is 1. .El .Sh SEE ALSO .Xr arp 4 , +.Xr bcma 4 , +.Xr bhnd 4 , +.Xr bhndb 4 , .Xr bwi 4 , .Xr cardbus 4 , .Xr intro 4 , .Xr pci 4 , +.Xr siba 4 , .Xr wlan 4 , .Xr wlan_amrr 4 , .Xr ifconfig 8 , @@ -145,12 +149,20 @@ The .Nm driver first appeared in .Fx 8.1 . +The driver was updated to support the common Broadcom +.Xr bhnd 4 +bus interface in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . +Support for +.Xr bhnd 4 +was added by +.An Landon Fuller Aq Mt landonf@FreeBSD.org . .\".Sh BUGS .\"Some card based on the BCM4306 and BCM4309 chips do not work properly .\"on channel 1, 2 and 3. Modified: user/jeff/numa/share/man/man7/arch.7 ============================================================================== --- user/jeff/numa/share/man/man7/arch.7 Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/share/man/man7/arch.7 Wed Feb 7 00:50:40 2018 (r328962) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2018 +.Dd February 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -416,7 +416,7 @@ imply little endian. If we ever were to support the so-called x32 ABI (using 32-bit pointers on the amd64 architecture), it would most likely be encoded as amd64-x32. -It is unfortunate that amd64 speifies the 64-bit evolution of the x86 +It is unfortunate that amd64 specifies the 64-bit evolution of the x86 platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. Modified: user/jeff/numa/share/man/man8/rc.subr.8 ============================================================================== --- user/jeff/numa/share/man/man8/rc.subr.8 Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/share/man/man8/rc.subr.8 Wed Feb 7 00:50:40 2018 (r328962) @@ -551,7 +551,7 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to +This will be passed as arguments to the .Xr env 1 utility. .It Va ${name}_fib @@ -583,6 +583,13 @@ as. Only supported after .Pa /usr is mounted. +.It Va ${name}_limits +.Xr limits 1 +to apply to +.Va command . +This will be passed as arguments to the +.Xr limits 1 +utility. .It Va ${name}_oomprotect .Xr protect 1 .Va command Modified: user/jeff/numa/share/man/man9/bus_map_resource.9 ============================================================================== --- user/jeff/numa/share/man/man9/bus_map_resource.9 Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/share/man/man9/bus_map_resource.9 Wed Feb 7 00:50:40 2018 (r328962) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd February 5, 2018 .Dt BUS_MAP_RESOURCE 9 .Os .Sh NAME @@ -143,16 +143,16 @@ reads the first 32-bit word: .Bd -literal struct resource *r; struct resource_map map; - struct resource_map_args args; + struct resource_map_request req; uint32_t val; int rid; rid = PCIR_BAR(0); r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_UNMAPPED); - resource_init_map_request(&args); - args.memattr = VM_MEMATTR_WRITE_COMBINING; - bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); + resource_init_map_request(&req); + req.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &req, &map); val = bus_read_4(&map, 0); .Ed .Sh SEE ALSO Modified: user/jeff/numa/share/mk/src.libnames.mk ============================================================================== --- user/jeff/numa/share/mk/src.libnames.mk Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/share/mk/src.libnames.mk Wed Feb 7 00:50:40 2018 (r328962) @@ -44,7 +44,6 @@ _INTERNALLIBS= \ parse \ pe \ pmcstat \ - readline \ sl \ sm \ smdb \ @@ -147,7 +146,6 @@ _LIBRARIES= \ procstat \ pthread \ radius \ - readline \ regex \ roken \ rpcsec_gss \ @@ -290,7 +288,6 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_readline= ncursesw _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken @@ -413,9 +410,6 @@ LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBPEDIR= ${OBJTOP}/lib/libpe LIBPE?= ${LIBPEDIR}/libpe.a - -LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline -LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a Modified: user/jeff/numa/stand/common/load_elf_obj.c ============================================================================== --- user/jeff/numa/stand/common/load_elf_obj.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/stand/common/load_elf_obj.c Wed Feb 7 00:50:40 2018 (r328962) @@ -282,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: user/jeff/numa/sys/cam/ata/ata_da.c ============================================================================== --- user/jeff/numa/sys/cam/ata/ata_da.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/ata/ata_da.c Wed Feb 7 00:50:40 2018 (r328962) @@ -911,7 +911,7 @@ adaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -1328,7 +1328,7 @@ adaasync(void *callback_arg, u_int32_t code, softc->state = ADA_STATE_LOGDIR; else break; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) softc->state = ADA_STATE_NORMAL; else xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -1841,7 +1841,7 @@ adaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * adadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -1866,7 +1866,7 @@ adaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: user/jeff/numa/sys/cam/ata/ata_pmp.c ============================================================================== --- user/jeff/numa/sys/cam/ata/ata_pmp.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/ata/ata_pmp.c Wed Feb 7 00:50:40 2018 (r328962) @@ -315,7 +315,7 @@ pmpasync(void *callback_arg, u_int32_t code, if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) softc->state = PMP_STATE_PM_QUIRKS_1; @@ -343,7 +343,7 @@ pmpsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct pmp_softc *)periph->softc; Modified: user/jeff/numa/sys/cam/ata/ata_xpt.c ============================================================================== --- user/jeff/numa/sys/cam/ata/ata_xpt.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/ata/ata_xpt.c Wed Feb 7 00:50:40 2018 (r328962) @@ -280,7 +280,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -304,10 +303,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); ata_device_transport(periph->path); probeschedule(periph); Modified: user/jeff/numa/sys/cam/cam_periph.c ============================================================================== --- user/jeff/numa/sys/cam/cam_periph.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/cam_periph.c Wed Feb 7 00:50:40 2018 (r328962) @@ -403,19 +403,19 @@ retry: return (count); } -cam_status +int cam_periph_acquire(struct cam_periph *periph) { - cam_status status; + int status; - status = CAM_REQ_CMP_ERR; if (periph == NULL) - return (status); + return (EINVAL); + status = ENOENT; xpt_lock_buses(); if ((periph->flags & CAM_PERIPH_INVALID) == 0) { periph->refcount++; - status = CAM_REQ_CMP; + status = 0; } xpt_unlock_buses(); @@ -482,7 +482,7 @@ cam_periph_hold(struct cam_periph *periph, int priorit * from user us while we sleep. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_assert(periph, MA_OWNED); Modified: user/jeff/numa/sys/cam/cam_periph.h ============================================================================== --- user/jeff/numa/sys/cam/cam_periph.h Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/cam_periph.h Wed Feb 7 00:50:40 2018 (r328962) @@ -159,7 +159,7 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor ac_callback_t *, ac_code, void *arg); struct cam_periph *cam_periph_find(struct cam_path *path, char *name); int cam_periph_list(struct cam_path *, struct sbuf *); -cam_status cam_periph_acquire(struct cam_periph *periph); +int cam_periph_acquire(struct cam_periph *periph); void cam_periph_doacquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); Modified: user/jeff/numa/sys/cam/ctl/scsi_ctl.c ============================================================================== --- user/jeff/numa/sys/cam/ctl/scsi_ctl.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/ctl/scsi_ctl.c Wed Feb 7 00:50:40 2018 (r328962) @@ -459,7 +459,7 @@ ctlferegister(struct cam_periph *periph, void *arg) struct ctlfe_lun_softc *softc; union ccb ccb; cam_status status; - int i; + int i, acstatus; softc = (struct ctlfe_lun_softc *)arg; bus_softc = softc->parent_softc; @@ -539,11 +539,11 @@ ctlferegister(struct cam_periph *periph, void *arg) } } - status = cam_periph_acquire(periph); - if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + acstatus = cam_periph_acquire(periph); + if (acstatus != 0) { xpt_print(periph->path, "%s: could not acquire reference " - "count, status = %#x\n", __func__, status); - return (status); + "count, status = %#x\n", __func__, acstatus); + return (CAM_REQ_CMP_ERR); } if (i == 0) { Modified: user/jeff/numa/sys/cam/mmc/mmc_da.c ============================================================================== --- user/jeff/numa/sys/cam/mmc/mmc_da.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/mmc/mmc_da.c Wed Feb 7 00:50:40 2018 (r328962) @@ -369,7 +369,7 @@ sddaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -744,7 +744,7 @@ sdda_hook_into_geom(struct cam_periph *periph) * We'll release this reference once GEOM calls us back (via * sddadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: user/jeff/numa/sys/cam/mmc/mmc_xpt.c ============================================================================== --- user/jeff/numa/sys/cam/mmc/mmc_xpt.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/mmc/mmc_xpt.c Wed Feb 7 00:50:40 2018 (r328962) @@ -471,9 +471,9 @@ probe_periph_init() static cam_status mmcprobe_register(struct cam_periph *periph, void *arg) { - union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; mmcprobe_softc *softc; + union ccb *request_ccb; /* CCB representing the probe request */ + int status; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmcprobe_register\n")); @@ -501,10 +501,10 @@ mmcprobe_register(struct cam_periph *periph, void *arg status = cam_periph_acquire(periph); memset(&periph->path->device->mmc_ident_data, 0, sizeof(struct mmc_params)); - if (status != CAM_REQ_CMP) { + if (status != 0) { printf("proberegister: cam_periph_acquire failed (status=%d)\n", status); - return (status); + return (CAM_REQ_CMP_ERR); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); Modified: user/jeff/numa/sys/cam/nvme/nvme_da.c ============================================================================== --- user/jeff/numa/sys/cam/nvme/nvme_da.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/nvme/nvme_da.c Wed Feb 7 00:50:40 2018 (r328962) @@ -260,7 +260,7 @@ ndaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -785,7 +785,7 @@ ndaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * ndadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -807,7 +807,7 @@ ndaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: user/jeff/numa/sys/cam/nvme/nvme_xpt.c ============================================================================== --- user/jeff/numa/sys/cam/nvme/nvme_xpt.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/nvme/nvme_xpt.c Wed Feb 7 00:50:40 2018 (r328962) @@ -198,7 +198,6 @@ static cam_status nvme_probe_register(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; nvme_probe_softc *softc; request_ccb = (union ccb *)arg; @@ -222,10 +221,9 @@ nvme_probe_register(struct cam_periph *periph, void *a periph->softc = softc; softc->periph = periph; softc->action = NVME_PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); // nvme_device_transport(periph->path); Modified: user/jeff/numa/sys/cam/scsi/scsi_cd.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_cd.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_cd.c Wed Feb 7 00:50:40 2018 (r328962) @@ -445,7 +445,7 @@ cdasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct cd_softc *)periph->softc; if (softc->state == CD_STATE_NORMAL && !softc->tur) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } @@ -480,7 +480,7 @@ cdsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct cd_softc *)periph->softc; @@ -676,7 +676,7 @@ cdregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -717,7 +717,7 @@ cdopen(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; softc = (struct cd_softc *)periph->softc; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return(ENXIO); cam_periph_lock(periph); @@ -2601,7 +2601,7 @@ cdmediapoll(void *arg) if (softc->state == CD_STATE_NORMAL && !softc->tur && softc->outstanding_cmds == 0) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } Modified: user/jeff/numa/sys/cam/scsi/scsi_da.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_da.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_da.c Wed Feb 7 00:50:40 2018 (r328962) @@ -1565,7 +1565,7 @@ da_periph_acquire(struct cam_periph *periph, da_ref_to token_sanity(token); DA_PERIPH_PRINT(periph, "acquiring device %s (%d): %d\n", da_ref_text[token], token, err); - if (err == CAM_REQ_CMP) { + if (err == 0) { int cnt; struct da_softc *softc = periph->softc; @@ -1628,7 +1628,7 @@ daopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (da_periph_acquire(periph, DA_REF_OPEN) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_OPEN) != 0) { return (ENXIO); } @@ -2061,7 +2061,7 @@ daasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } @@ -2732,7 +2732,7 @@ daregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (da_periph_acquire(periph, DA_REF_GEOM) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_GEOM) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -4700,7 +4700,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * we have successfully attached. */ /* increase the refcount */ - if (da_periph_acquire(periph, DA_REF_SYSCTL) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_SYSCTL) == 0) { taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); @@ -5558,7 +5558,7 @@ static void dareprobe(struct cam_periph *periph) { struct da_softc *softc; - cam_status status; + int status; softc = (struct da_softc *)periph->softc; @@ -5567,8 +5567,7 @@ dareprobe(struct cam_periph *periph) return; status = da_periph_acquire(periph, DA_REF_REPROBE); - KASSERT(status == CAM_REQ_CMP, - ("dareprobe: cam_periph_acquire failed")); + KASSERT(status == 0, ("dareprobe: cam_periph_acquire failed")); softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -5666,7 +5665,7 @@ damediapoll(void *arg) if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && LIST_EMPTY(&softc->pending_ccbs)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } Modified: user/jeff/numa/sys/cam/scsi/scsi_enc.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_enc.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_enc.c Wed Feb 7 00:50:40 2018 (r328962) @@ -267,7 +267,7 @@ enc_open(struct cdev *dev, int flags, int fmt, struct int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); @@ -859,7 +859,7 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, cam_periph_mtx(enc->periph), 0); - if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + if (cam_periph_acquire(enc->periph) != 0) return (ENXIO); result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, @@ -975,7 +975,7 @@ enc_ctor(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: user/jeff/numa/sys/cam/scsi/scsi_pass.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_pass.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_pass.c Wed Feb 7 00:50:40 2018 (r328962) @@ -518,7 +518,6 @@ passasync(void *callback_arg, u_int32_t code, buftype = (uintptr_t)arg; if (buftype == CDAI_TYPE_PHYS_PATH) { struct pass_softc *softc; - cam_status status; softc = (struct pass_softc *)periph->softc; /* @@ -527,8 +526,7 @@ passasync(void *callback_arg, u_int32_t code, * a situation where the periph goes away before * the task queue has a chance to run. */ - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) break; taskqueue_enqueue(taskqueue_thread, @@ -626,7 +624,7 @@ passregister(struct cam_periph *periph, void *arg) * Acquire a reference to the periph that we can release once we've * cleaned up the kqueue. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -638,7 +636,7 @@ passregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -665,7 +663,7 @@ passregister(struct cam_periph *periph, void *arg) * Hold a reference to the periph before we create the physical * path alias so it can't go away. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -705,7 +703,7 @@ passopen(struct cdev *dev, int flags, int fmt, struct int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); Modified: user/jeff/numa/sys/cam/scsi/scsi_pt.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_pt.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_pt.c Wed Feb 7 00:50:40 2018 (r328962) @@ -142,7 +142,7 @@ ptopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); softc = (struct pt_softc *)periph->softc; Modified: user/jeff/numa/sys/cam/scsi/scsi_sa.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_sa.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_sa.c Wed Feb 7 00:50:40 2018 (r328962) @@ -657,7 +657,7 @@ saopen(struct cdev *dev, int flags, int fmt, struct th int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return (ENXIO); } @@ -2495,7 +2495,7 @@ saregister(struct cam_periph *periph, void *arg) * instances for it. We'll release this reference once the devfs * instances have been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: user/jeff/numa/sys/cam/scsi/scsi_sg.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_sg.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_sg.c Wed Feb 7 00:50:40 2018 (r328962) @@ -353,7 +353,7 @@ sgregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -439,7 +439,7 @@ sgopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); /* Modified: user/jeff/numa/sys/cam/scsi/scsi_xpt.c ============================================================================== --- user/jeff/numa/sys/cam/scsi/scsi_xpt.c Tue Feb 6 23:50:02 2018 (r328961) +++ user/jeff/numa/sys/cam/scsi/scsi_xpt.c Wed Feb 7 00:50:40 2018 (r328962) @@ -657,7 +657,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -681,10 +680,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); scsi_devise_transport(periph->path); Modified: user/jeff/numa/sys/conf/files ============================================================================== --- user/jeff/numa/sys/conf/files Tue Feb 6 23:50:02 2018 (r328961) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Wed Feb 7 01:24:50 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A576F1A8C3 for ; Wed, 7 Feb 2018 01:24:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCF946EC89; Wed, 7 Feb 2018 01:24:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7D0120067; Wed, 7 Feb 2018 01:24:49 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w171OnWr035335; Wed, 7 Feb 2018 01:24:49 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w171OnSb035334; Wed, 7 Feb 2018 01:24:49 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802070124.w171OnSb035334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 7 Feb 2018 01:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328963 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 328963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 01:24:50 -0000 Author: jeff Date: Wed Feb 7 01:24:49 2018 New Revision: 328963 URL: https://svnweb.freebsd.org/changeset/base/328963 Log: The buf queue may change while the buf is locked. This can only occur when it is being pushed from a per-cpu queue to the cleanq. Detect this condition in bufqueue_acquire(). Reported by: pho Modified: user/jeff/numa/sys/kern/vfs_bio.c Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Wed Feb 7 00:50:40 2018 (r328962) +++ user/jeff/numa/sys/kern/vfs_bio.c Wed Feb 7 01:24:49 2018 (r328963) @@ -1309,6 +1309,7 @@ static struct bufqueue * bufqueue(struct buf *bp) { struct bufdomain *bd; + int cpu; switch (bp->b_qindex) { case QUEUE_NONE: @@ -1326,10 +1327,37 @@ bufqueue(struct buf *bp) panic("bufqueue(%p): Unhandled type %d\n", bp, bp->b_qindex); } bd = &bdclean[bp->b_domain]; - if (bp->b_cpu > mp_maxid) + /* cpu may be changed by bd_flush(). Read it only once. */ + cpu = bp->b_cpu; + if (cpu > mp_maxid) return (&bd->bd_cleanq); - return (&bd->bd_cpuq[bp->b_cpu]); + return (&bd->bd_cpuq[cpu]); +} +/* + * Return the locked bufqueue that bp is a member of. + */ +static struct bufqueue * +bufqueue_acquire(struct buf *bp) +{ + struct bufqueue *bq, *nbq; + + /* + * bp can be pushed from a per-cpu queue to the + * cleanq while we're waiting on the lock. Retry + * if the queues don't match. + */ + bq = bufqueue(bp); + BQ_LOCK(bq); + for (;;) { + nbq = bufqueue(bp); + if (bq == nbq) + break; + BQ_UNLOCK(bq); + BQ_LOCK(nbq); + bq = nbq; + } + return (bq); } /* @@ -1358,8 +1386,7 @@ binsfree(struct buf *bp, int qindex) BUF_UNLOCK(bp); return; } - bq = bufqueue(bp); - BQ_LOCK(bq); + bq = bufqueue_acquire(bp); bq_remove(bq, bp); BQ_UNLOCK(bq); } @@ -1647,8 +1674,7 @@ bremfreef(struct buf *bp) { struct bufqueue *bq; - bq = bufqueue(bp); - BQ_LOCK(bq); + bq = bufqueue_acquire(bp); bq_remove(bq, bp); BQ_UNLOCK(bq); } From owner-svn-src-user@freebsd.org Wed Feb 7 19:53:19 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35283EC83A4 for ; Wed, 7 Feb 2018 19:53:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D48037BE0B; Wed, 7 Feb 2018 19:53:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4297399A; Wed, 7 Feb 2018 19:53:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17JrIuk091166; Wed, 7 Feb 2018 19:53:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JrEwQ091125; Wed, 7 Feb 2018 19:53:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802071953.w17JrEwQ091125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 19:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328993 - in user/markj/netdump: . bin/sh contrib/gcc/config/mips contrib/gdb/gdb/tui contrib/libreadline contrib/netbsd-tests/kernel etc etc/rc.d gnu/lib gnu/lib/libreadline gnu/usr.bi... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: . bin/sh contrib/gcc/config/mips contrib/gdb/gdb/tui contrib/libreadline contrib/netbsd-tests/kernel etc etc/rc.d gnu/lib gnu/lib/libreadline gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb... X-SVN-Commit-Revision: 328993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 19:53:19 -0000 Author: markj Date: Wed Feb 7 19:53:14 2018 New Revision: 328993 URL: https://svnweb.freebsd.org/changeset/base/328993 Log: MFH at r328991. Added: user/markj/netdump/stand/usb/test/ - copied from r328991, head/stand/usb/test/ user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c - copied unchanged from r328991, head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h - copied unchanged from r328991, head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h user/markj/netdump/sys/i386/i386/sigtramp.s - copied unchanged from r328991, head/sys/i386/i386/sigtramp.s user/markj/netdump/sys/vm/vm_pagequeue.h - copied unchanged from r328991, head/sys/vm/vm_pagequeue.h Deleted: user/markj/netdump/contrib/libreadline/ user/markj/netdump/gnu/lib/libreadline/ user/markj/netdump/gnu/usr.bin/gdb/gdbtui/ user/markj/netdump/stand/usb/Makefile.test user/markj/netdump/stand/usb/bsd_usbloader_test.c user/markj/netdump/sys/arm/conf/BWCT user/markj/netdump/sys/arm/conf/BWCT.hints user/markj/netdump/sys/arm/conf/EB9200 user/markj/netdump/sys/arm/conf/EB9200.hints user/markj/netdump/sys/arm/conf/ETHERNUT5 user/markj/netdump/sys/arm/conf/ETHERNUT5.hints user/markj/netdump/sys/arm/conf/HL200 user/markj/netdump/sys/arm/conf/HL201 user/markj/netdump/sys/arm/conf/HL201.hints user/markj/netdump/sys/arm/conf/KB920X user/markj/netdump/sys/arm/conf/KB920X.hints user/markj/netdump/sys/arm/conf/QILA9G20 user/markj/netdump/sys/arm/conf/QILA9G20.hints user/markj/netdump/sys/arm/conf/SAM9260EK user/markj/netdump/sys/arm/conf/SAM9260EK.hints user/markj/netdump/sys/arm/conf/SAM9X25EK user/markj/netdump/sys/arm/conf/SAM9X25EK.hints user/markj/netdump/sys/arm/conf/SN9G45 user/markj/netdump/sys/dev/bwn/if_bwn_bhnd.c user/markj/netdump/sys/dev/bwn/if_bwn_chipid.h user/markj/netdump/sys/dev/bwn/if_bwn_siba.c user/markj/netdump/sys/dev/bwn/if_bwn_siba.h user/markj/netdump/sys/dev/bwn/if_bwn_siba_compat.c user/markj/netdump/sys/dev/bwn/if_bwn_siba_compat.h user/markj/netdump/sys/dev/siba/ user/markj/netdump/sys/modules/bwn_pci/ user/markj/netdump/sys/modules/siba_bwn/ Modified: user/markj/netdump/Makefile user/markj/netdump/Makefile.inc1 user/markj/netdump/ObsoleteFiles.inc user/markj/netdump/bin/sh/mkbuiltins user/markj/netdump/bin/sh/mktokens user/markj/netdump/contrib/gcc/config/mips/mips.h user/markj/netdump/contrib/gdb/gdb/tui/tui-io.c user/markj/netdump/contrib/netbsd-tests/kernel/t_sysv.c user/markj/netdump/etc/rc user/markj/netdump/etc/rc.d/cleanvar user/markj/netdump/etc/regdomain.xml user/markj/netdump/gnu/lib/Makefile user/markj/netdump/gnu/usr.bin/gdb/Makefile user/markj/netdump/gnu/usr.bin/gdb/Makefile.inc user/markj/netdump/gnu/usr.bin/gdb/gdb/Makefile user/markj/netdump/gnu/usr.bin/gdb/kgdb/Makefile user/markj/netdump/lib/libc/mips/gen/_ctx_start.S user/markj/netdump/lib/libc/sys/fsync.2 user/markj/netdump/lib/libcasper/libcasper/libcasper.3 user/markj/netdump/sbin/etherswitchcfg/etherswitchcfg.c user/markj/netdump/share/man/man4/bwn.4 user/markj/netdump/share/man/man7/arch.7 user/markj/netdump/share/man/man8/rc.subr.8 user/markj/netdump/share/man/man9/bus_map_resource.9 user/markj/netdump/share/mk/bsd.compiler.mk user/markj/netdump/share/mk/bsd.linker.mk user/markj/netdump/share/mk/src.libnames.mk user/markj/netdump/share/zoneinfo/Makefile user/markj/netdump/stand/common/load_elf_obj.c user/markj/netdump/stand/kshim/bsd_kernel.h user/markj/netdump/stand/usb/usbcore.mk user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/linux/linux.h user/markj/netdump/sys/amd64/linux/linux_ptrace.c user/markj/netdump/sys/amd64/linux/linux_sysvec.c user/markj/netdump/sys/amd64/linux/syscalls.master user/markj/netdump/sys/amd64/linux32/linux.h user/markj/netdump/sys/amd64/linux32/linux32_dummy.c user/markj/netdump/sys/amd64/linux32/linux32_locore.s user/markj/netdump/sys/amd64/linux32/linux32_sysvec.c user/markj/netdump/sys/amd64/linux32/syscalls.master user/markj/netdump/sys/arm/allwinner/if_awg.c user/markj/netdump/sys/arm/arm/machdep.c user/markj/netdump/sys/arm/arm/pmap-v4.c user/markj/netdump/sys/cam/ata/ata_da.c user/markj/netdump/sys/cam/ata/ata_pmp.c user/markj/netdump/sys/cam/ata/ata_xpt.c user/markj/netdump/sys/cam/cam_iosched.c user/markj/netdump/sys/cam/cam_periph.c user/markj/netdump/sys/cam/cam_periph.h user/markj/netdump/sys/cam/ctl/scsi_ctl.c user/markj/netdump/sys/cam/mmc/mmc_da.c user/markj/netdump/sys/cam/mmc/mmc_xpt.c user/markj/netdump/sys/cam/nvme/nvme_da.c user/markj/netdump/sys/cam/nvme/nvme_xpt.c user/markj/netdump/sys/cam/scsi/scsi_cd.c user/markj/netdump/sys/cam/scsi/scsi_da.c user/markj/netdump/sys/cam/scsi/scsi_enc.c user/markj/netdump/sys/cam/scsi/scsi_pass.c user/markj/netdump/sys/cam/scsi/scsi_pt.c user/markj/netdump/sys/cam/scsi/scsi_sa.c user/markj/netdump/sys/cam/scsi/scsi_sg.c user/markj/netdump/sys/cam/scsi/scsi_xpt.c user/markj/netdump/sys/cddl/compat/opensolaris/sys/kmem.h user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/markj/netdump/sys/compat/linprocfs/linprocfs.c user/markj/netdump/sys/compat/linux/check_internal_locks.d user/markj/netdump/sys/compat/linux/linux_emul.c user/markj/netdump/sys/compat/linux/linux_event.c user/markj/netdump/sys/compat/linux/linux_file.h user/markj/netdump/sys/compat/linux/linux_fork.c user/markj/netdump/sys/compat/linux/linux_ioctl.c user/markj/netdump/sys/compat/linux/linux_ioctl.h user/markj/netdump/sys/compat/linux/linux_ipc.c user/markj/netdump/sys/compat/linux/linux_ipc.h user/markj/netdump/sys/compat/linux/linux_ipc64.h user/markj/netdump/sys/compat/linux/linux_misc.c user/markj/netdump/sys/compat/linux/linux_persona.h user/markj/netdump/sys/compat/linux/linux_signal.c user/markj/netdump/sys/compat/linux/linux_socket.c user/markj/netdump/sys/compat/linux/linux_socket.h user/markj/netdump/sys/compat/linux/linux_time.c user/markj/netdump/sys/compat/linux/linux_util.h user/markj/netdump/sys/compat/linux/stats_timing.d user/markj/netdump/sys/compat/linux/trace_futexes.d user/markj/netdump/sys/compat/linuxkpi/common/include/linux/ktime.h user/markj/netdump/sys/conf/files user/markj/netdump/sys/conf/files.i386 user/markj/netdump/sys/dev/ath/if_ath.c user/markj/netdump/sys/dev/bhnd/bhnd_ids.h user/markj/netdump/sys/dev/bwn/if_bwn.c user/markj/netdump/sys/dev/bwn/if_bwn_misc.h user/markj/netdump/sys/dev/bwn/if_bwn_pci.c user/markj/netdump/sys/dev/bwn/if_bwn_phy_common.c user/markj/netdump/sys/dev/bwn/if_bwn_phy_common.h user/markj/netdump/sys/dev/bwn/if_bwn_phy_g.c user/markj/netdump/sys/dev/bwn/if_bwn_phy_lp.c user/markj/netdump/sys/dev/bwn/if_bwn_phy_n.c user/markj/netdump/sys/dev/bwn/if_bwn_util.c user/markj/netdump/sys/dev/bwn/if_bwnreg.h user/markj/netdump/sys/dev/bwn/if_bwnvar.h user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_9340.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchreg.h user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchvar.h user/markj/netdump/sys/dev/etherswitch/etherswitch.h user/markj/netdump/sys/dev/mpr/mpr.c user/markj/netdump/sys/dev/mpr/mpr_sas.c user/markj/netdump/sys/dev/mpr/mpr_user.c user/markj/netdump/sys/dev/mpr/mprvar.h user/markj/netdump/sys/dev/mps/mps.c user/markj/netdump/sys/dev/mps/mps_sas.c user/markj/netdump/sys/dev/mps/mps_user.c user/markj/netdump/sys/dev/mps/mpsvar.h user/markj/netdump/sys/dev/usb/template/usb_template_audio.c user/markj/netdump/sys/dev/usb/template/usb_template_cdce.c user/markj/netdump/sys/dev/usb/template/usb_template_kbd.c user/markj/netdump/sys/dev/usb/template/usb_template_midi.c user/markj/netdump/sys/dev/usb/template/usb_template_modem.c user/markj/netdump/sys/dev/usb/template/usb_template_mouse.c user/markj/netdump/sys/dev/usb/template/usb_template_msc.c user/markj/netdump/sys/dev/usb/template/usb_template_mtp.c user/markj/netdump/sys/dev/usb/template/usb_template_phone.c user/markj/netdump/sys/dev/usb/template/usb_template_serialnet.c user/markj/netdump/sys/fs/ext2fs/ext2_lookup.c user/markj/netdump/sys/fs/tmpfs/tmpfs_subr.c user/markj/netdump/sys/geom/mirror/g_mirror.c user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.h user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c user/markj/netdump/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c user/markj/netdump/sys/i386/i386/locore.s user/markj/netdump/sys/i386/i386/machdep.c user/markj/netdump/sys/i386/linux/linux.h user/markj/netdump/sys/i386/linux/linux_dummy.c user/markj/netdump/sys/i386/linux/linux_locore.s user/markj/netdump/sys/i386/linux/linux_machdep.c user/markj/netdump/sys/i386/linux/linux_support.s user/markj/netdump/sys/i386/linux/linux_sysvec.c user/markj/netdump/sys/i386/linux/syscalls.master user/markj/netdump/sys/kern/imgact_elf.c user/markj/netdump/sys/kern/init_main.c user/markj/netdump/sys/kern/kern_malloc.c user/markj/netdump/sys/kern/kern_sendfile.c user/markj/netdump/sys/kern/link_elf_obj.c user/markj/netdump/sys/kern/subr_clock.c user/markj/netdump/sys/kern/subr_fattime.c user/markj/netdump/sys/kern/subr_vmem.c user/markj/netdump/sys/kern/subr_witness.c user/markj/netdump/sys/kern/vfs_bio.c user/markj/netdump/sys/kern/vfs_extattr.c user/markj/netdump/sys/mips/conf/TL-WDR4300.hints user/markj/netdump/sys/mips/mips/busdma_machdep.c user/markj/netdump/sys/mips/mips/machdep.c user/markj/netdump/sys/modules/Makefile user/markj/netdump/sys/modules/bwn/Makefile user/markj/netdump/sys/modules/dtb/allwinner/Makefile user/markj/netdump/sys/modules/ipfw/Makefile user/markj/netdump/sys/netinet/ip_fw.h user/markj/netdump/sys/netpfil/ipfw/ip_fw2.c user/markj/netdump/sys/netpfil/ipfw/ip_fw_dynamic.c user/markj/netdump/sys/netpfil/ipfw/ip_fw_private.h user/markj/netdump/sys/netpfil/ipfw/ip_fw_sockopt.c user/markj/netdump/sys/powerpc/booke/pmap.c user/markj/netdump/sys/powerpc/powerpc/machdep.c user/markj/netdump/sys/sparc64/sparc64/machdep.c user/markj/netdump/sys/sys/bus_dma.h user/markj/netdump/sys/sys/clock.h user/markj/netdump/sys/sys/vmmeter.h user/markj/netdump/sys/ufs/ffs/ffs_alloc.c user/markj/netdump/sys/ufs/ffs/ffs_vfsops.c user/markj/netdump/sys/ufs/ufs/ufs_vnops.c user/markj/netdump/sys/vm/swap_pager.c user/markj/netdump/sys/vm/uma.h user/markj/netdump/sys/vm/uma_core.c user/markj/netdump/sys/vm/uma_int.h user/markj/netdump/sys/vm/vm_extern.h user/markj/netdump/sys/vm/vm_glue.c user/markj/netdump/sys/vm/vm_init.c user/markj/netdump/sys/vm/vm_kern.c user/markj/netdump/sys/vm/vm_map.c user/markj/netdump/sys/vm/vm_meter.c user/markj/netdump/sys/vm/vm_object.c user/markj/netdump/sys/vm/vm_object.h user/markj/netdump/sys/vm/vm_page.c user/markj/netdump/sys/vm/vm_page.h user/markj/netdump/sys/vm/vm_pageout.c user/markj/netdump/sys/vm/vm_pageout.h user/markj/netdump/sys/vm/vm_phys.c user/markj/netdump/sys/vm/vm_phys.h user/markj/netdump/sys/vm/vm_radix.c user/markj/netdump/sys/vm/vm_reserv.c user/markj/netdump/sys/vm/vm_reserv.h user/markj/netdump/sys/vm/vm_swapout.c user/markj/netdump/sys/vm/vnode_pager.c user/markj/netdump/targets/pseudo/userland/gnu/Makefile.depend user/markj/netdump/tests/sys/kern/Makefile user/markj/netdump/tools/build/mk/OptionalObsoleteFiles.inc user/markj/netdump/usr.bin/find/Makefile user/markj/netdump/usr.bin/find/find.h user/markj/netdump/usr.bin/find/function.c user/markj/netdump/usr.bin/find/ls.c user/markj/netdump/usr.bin/find/operator.c user/markj/netdump/usr.bin/find/option.c user/markj/netdump/usr.bin/lex/initparse.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/contrib/gcc/ (props changed) user/markj/netdump/contrib/gdb/ (props changed) user/markj/netdump/contrib/netbsd-tests/ (props changed) user/markj/netdump/gnu/lib/ (props changed) user/markj/netdump/gnu/usr.bin/gdb/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/Makefile ============================================================================== --- user/markj/netdump/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -106,9 +106,13 @@ # # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION -# can be cached for sub-makes. +# can be cached for sub-makes. We can't do this while still running on the +# old fmake from FreeBSD 9.x or older, so avoid including it then to avoid +# heartburn upgrading from older systems. The need for CC is done with new +# make later in the build, and caching COMPILER_TYPE/VERSION is only an +# optimization. Also sinclude it to be friendlier to foreign OS hosted builds. .if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR) -.include +.sinclude .endif # Note: we use this awkward construct to be compatible with FreeBSD's @@ -352,7 +356,7 @@ _guard: .PHONY @false STARTTIME!= LC_ALL=C date -CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo +CHECK_TIME!= cmp=`mktemp`; find ${.CURDIR}/sys/sys/param.h -newer "$$cmp" && rm "$$cmp"; echo .if !empty(CHECK_TIME) .error check your date/time: ${STARTTIME} .endif Modified: user/markj/netdump/Makefile.inc1 ============================================================================== --- user/markj/netdump/Makefile.inc1 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/Makefile.inc1 Wed Feb 7 19:53:14 2018 (r328993) @@ -85,8 +85,10 @@ MK_GCC_BOOTSTRAP= no .-include "${OBJTOP}/compiler-metadata.mk" .endif -# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. -.include +# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the +# tree to be friendlier to foreign OS builds. It's safe to do so unconditionally +# here since we will always have the right make, unlike in src/Makefile +.include "share/mk/bsd.compiler.mk" .include "share/mk/src.opts.mk" # Check if there is a local compiler that can satisfy as an external compiler. @@ -165,11 +167,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES=${COMPILER_FEATURES} \ + COMPILER_FEATURES="${COMPILER_FEATURES}" \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES=${X_COMPILER_FEATURES} \ + COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif @@ -463,7 +465,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} # when in the middle of installing over this system. # .if make(distributeworld) || make(installworld) || make(stageworld) -INSTALLTMP!= /usr/bin/mktemp -d -u -t install +INSTALLTMP!= mktemp -d -u -t install .endif .if make(stagekernel) || make(distributekernel) Modified: user/markj/netdump/ObsoleteFiles.inc ============================================================================== --- user/markj/netdump/ObsoleteFiles.inc Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/ObsoleteFiles.inc Wed Feb 7 19:53:14 2018 (r328993) @@ -38,10 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180206: remove gdbtui +OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files OLD_FILES+=boot/efi.4th OLD_FILES+=boot/pcibios.4th - # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: user/markj/netdump/bin/sh/mkbuiltins ============================================================================== --- user/markj/netdump/bin/sh/mkbuiltins Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/bin/sh/mkbuiltins Wed Feb 7 19:53:14 2018 (r328993) @@ -34,7 +34,7 @@ # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 # $FreeBSD$ -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 Modified: user/markj/netdump/bin/sh/mktokens ============================================================================== --- user/markj/netdump/bin/sh/mktokens Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/bin/sh/mktokens Wed Feb 7 19:53:14 2018 (r328993) @@ -38,7 +38,7 @@ # token marks the end of a list. The third column is the name to print in # error messages. -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` cat > $temp <<\! TEOF 1 end of file TNL 0 newline Modified: user/markj/netdump/contrib/gcc/config/mips/mips.h ============================================================================== --- user/markj/netdump/contrib/gcc/config/mips/mips.h Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/contrib/gcc/config/mips/mips.h Wed Feb 7 19:53:14 2018 (r328993) @@ -2721,6 +2721,7 @@ while (0) nop\n\ 1: .cpload $31\n\ .set reorder\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif /* Switch to #elif when we're no longer limited by K&R C. */ @@ -2733,6 +2734,7 @@ while (0) nop\n\ 1: .set reorder\n\ .cpsetup $31, $2, 1b\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif Modified: user/markj/netdump/contrib/gdb/gdb/tui/tui-io.c ============================================================================== --- user/markj/netdump/contrib/gdb/gdb/tui/tui-io.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/contrib/gdb/gdb/tui/tui-io.c Wed Feb 7 19:53:14 2018 (r328993) @@ -397,7 +397,7 @@ static void tui_rl_display_match_list (char **matches, int len, int max) { typedef int QSFUNC (const void *, const void *); - extern int _rl_qsort_string_compare (const void*, const void*); + extern int _rl_qsort_string_compare (char **, char **); extern int _rl_print_completions_horizontally; int count, limit, printed_len; Modified: user/markj/netdump/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- user/markj/netdump/contrib/netbsd-tests/kernel/t_sysv.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/contrib/netbsd-tests/kernel/t_sysv.c Wed Feb 7 19:53:14 2018 (r328993) @@ -72,7 +72,7 @@ void sharer(void); #define MESSAGE_TEXT_LEN 256 -struct mymsg { +struct testmsg { long mtype; char mtext[MESSAGE_TEXT_LEN]; }; @@ -94,11 +94,13 @@ key_t msgkey, semkey, shmkey; int maxloop = 1; +#ifndef __FreeBSD__ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; +#endif /* Writes an integer to a file. To be used from the body of the test @@ -174,7 +176,7 @@ key_t get_ftok(int id) /* Create the file, since ftok() requires it to exist! */ - fd = open(token_key, O_RDWR | O_CREAT | O_EXCL); + fd = open(token_key, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd == -1) { rmdir(tmpdir); atf_tc_fail("open() of temp file failed: %d", errno); @@ -202,7 +204,7 @@ ATF_TC_BODY(msg, tc) { struct sigaction sa; struct msqid_ds m_ds; - struct mymsg m; + struct testmsg m; sigset_t sigmask; int sender_msqid; int loop; @@ -347,9 +349,7 @@ ATF_TC_CLEANUP(msg, tc) } void -print_msqid_ds(mp, mode) - struct msqid_ds *mp; - mode_t mode; +print_msqid_ds(struct msqid_ds *mp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -381,9 +381,9 @@ print_msqid_ds(mp, mode) } void -receiver() +receiver(void) { - struct mymsg m; + struct testmsg m; int msqid, loop; if ((msqid = msgget(msgkey, 0)) == -1) @@ -588,9 +588,7 @@ ATF_TC_CLEANUP(sem, tc) } void -print_semid_ds(sp, mode) - struct semid_ds *sp; - mode_t mode; +print_semid_ds(struct semid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -620,7 +618,7 @@ print_semid_ds(sp, mode) } void -waiter() +waiter(void) { struct sembuf s; int semid; @@ -789,9 +787,7 @@ ATF_TC_CLEANUP(shm, tc) } void -print_shmid_ds(sp, mode) - struct shmid_ds *sp; - mode_t mode; +print_shmid_ds(struct shmid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -823,7 +819,7 @@ print_shmid_ds(sp, mode) } void -sharer() +sharer(void) { int shmid; void *shm_buf; Modified: user/markj/netdump/etc/rc ============================================================================== --- user/markj/netdump/etc/rc Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/etc/rc Wed Feb 7 19:53:14 2018 (r328993) @@ -141,10 +141,10 @@ if [ -e ${firstboot_sentinel} ]; then if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo '' Modified: user/markj/netdump/etc/rc.d/cleanvar ============================================================================== --- user/markj/netdump/etc/rc.d/cleanvar Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/etc/rc.d/cleanvar Wed Feb 7 19:53:14 2018 (r328993) @@ -19,34 +19,6 @@ stop_cmd=":" extra_commands="reload" reload_cmd="${name}_start" -purgedir() -{ - local dir file - - if [ $# -eq 0 ]; then - purgedir . - else - for dir - do - ( - cd "$dir" && for file in .* * - do - # Skip over logging sockets - [ -S "$file" -a "$file" = "log" ] && continue - [ -S "$file" -a "$file" = "logpriv" ] && continue - [ ."$file" = .. -o ."$file" = ... ] && continue - if [ -d "$file" -a ! -L "$file" ] - then - purgedir "$file" - else - rm -f -- "$file" - fi - done - ) - done - fi -} - cleanvar_prestart() { # These files must be removed only the first time this script is run @@ -58,14 +30,17 @@ cleanvar_prestart() cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run + # Skip over logging sockets + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock + find /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi - rm -rf /var/spool/uucp/.Temp/* + if [ -d /var/spool/uucp/.Temp ]; then + find /var/spool/uucp/.Temp -delete + fi } load_rc_config $name Modified: user/markj/netdump/etc/regdomain.xml ============================================================================== --- user/markj/netdump/etc/regdomain.xml Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/etc/regdomain.xml Wed Feb 7 19:53:14 2018 (r328993) @@ -1595,7 +1595,7 @@ 642 Romania - 643 Rusia + 643 Russia 682 Saudi Arabia Modified: user/markj/netdump/gnu/lib/Makefile ============================================================================== --- user/markj/netdump/gnu/lib/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/gnu/lib/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -7,7 +7,6 @@ SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests -SUBDIR.${MK_GDB}+= libreadline .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" Modified: user/markj/netdump/gnu/usr.bin/gdb/Makefile ============================================================================== --- user/markj/netdump/gnu/usr.bin/gdb/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/gnu/usr.bin/gdb/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -5,8 +5,6 @@ SUBDIR= libgdb gdb kgdb .if ${MK_GDB_LIBEXEC} == "no" -SUBDIR+= gdbtui - .if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif Modified: user/markj/netdump/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- user/markj/netdump/gnu/usr.bin/gdb/Makefile.inc Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/gnu/usr.bin/gdb/Makefile.inc Wed Feb 7 19:53:14 2018 (r328993) @@ -13,11 +13,9 @@ BMAKE_BU= ${BMAKE_ROOT}/binutils CNTRB_BU= ${SRCTOP}/contrib/binutils CNTRB_GDB= ${SRCTOP}/contrib/gdb -CNTRB_RL= ${SRCTOP}/contrib/libreadline OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb -OBJ_RL= ${OBJTOP}/gnu/lib/libreadline/readline # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... @@ -37,7 +35,7 @@ GDB_CROSS_DEBUGGER= .PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \ ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} -CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} @@ -47,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${OBJ_RL:H} +CFLAGS+= -I${SRCTOP}/lib/libedit/edit GENSRCS+= nm.h tm.h Modified: user/markj/netdump/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- user/markj/netdump/gnu/usr.bin/gdb/gdb/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/gnu/usr.bin/gdb/gdb/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -13,7 +13,7 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex +LIBADD+= m edit ncursesw gnuregex .include CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: user/markj/netdump/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- user/markj/netdump/gnu/usr.bin/gdb/kgdb/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/gnu/usr.bin/gdb/kgdb/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -10,6 +10,6 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex kvm +LIBADD+= m edit ncursesw gnuregex kvm .include Modified: user/markj/netdump/lib/libc/mips/gen/_ctx_start.S ============================================================================== --- user/markj/netdump/lib/libc/mips/gen/_ctx_start.S Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/lib/libc/mips/gen/_ctx_start.S Wed Feb 7 19:53:14 2018 (r328993) @@ -28,11 +28,25 @@ __FBSDID("$FreeBSD$"); /* - * XXX gp? + * This requires makecontext() to setup a valid GP for locating + * _ctx_done rather than deriving GP from T9 on entry. Currently this + * uses the GP inherited from getcontext() assuming that getcontext() + * is in the same shared object as _ctx_done(). For N32 and N64, GP + * is caller-save so will be preserved across the call to the callback + * function. For O32, GP is callee-save, so save it in a different + * caller-save register (S1) while invoking the callback. This is + * done instead of the usual SETUP_GP/SAVE_GP to avoid disturbing the + * stack frame setup by makecontext() for the callback function. */ ENTRY(_ctx_start) +#ifdef __mips_o32 + move s1, gp +#endif jalr t9 +#ifdef __mips_o32 + move gp, s1 +#endif move a0, s0 PTR_LA t9, _ctx_done jalr t9 Modified: user/markj/netdump/lib/libc/sys/fsync.2 ============================================================================== --- user/markj/netdump/lib/libc/sys/fsync.2 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/lib/libc/sys/fsync.2 Wed Feb 7 19:53:14 2018 (r328993) @@ -34,7 +34,7 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd February 6, 2018 .Dt FSYNC 2 .Os .Sh NAME @@ -108,6 +108,7 @@ refers to a socket, not to a file. An I/O error occurred while reading from or writing to the file system. .El .Sh SEE ALSO +.Xr fsync 1 , .Xr sync 2 , .Xr syncer 4 , .Xr sync 8 Modified: user/markj/netdump/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- user/markj/netdump/lib/libcasper/libcasper/libcasper.3 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/lib/libcasper/libcasper/libcasper.3 Wed Feb 7 19:53:14 2018 (r328993) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2018 +.Dd February 5, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -47,6 +47,7 @@ .Sh LIBRARY .Lb libcasper .Sh SYNOPSIS +.Fd #define WITH_CASPER .In sys/nv.h .In libcasper.h .Ft "cap_channel_t *" Modified: user/markj/netdump/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- user/markj/netdump/sbin/etherswitchcfg/etherswitchcfg.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sbin/etherswitchcfg/etherswitchcfg.c Wed Feb 7 19:53:14 2018 (r328993) @@ -556,6 +556,13 @@ print_config(struct cfg *cfg) printf("none\n"); } } + + /* Print switch MAC address. */ + if (cfg->conf.cmd & ETHERSWITCH_CONF_SWITCH_MACADDR) { + printf("%s: Switch MAC address: %s\n", + c, + ether_ntoa(&cfg->conf.switch_macaddr)); + } } static void Modified: user/markj/netdump/share/man/man4/bwn.4 ============================================================================== --- user/markj/netdump/share/man/man4/bwn.4 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/man/man4/bwn.4 Wed Feb 7 19:53:14 2018 (r328993) @@ -24,26 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2015 +.Dd December 16, 2017 .Dt BWN 4 .Os .Sh NAME .Nm bwn -.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver +.Nd Broadcom BCM43xx SoftMAC IEEE 802.11 wireless network driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: +To compile this driver into the kernel, add the following lines to the kernel +configuration file: .Bd -ragged -offset indent -.Cd "device siba_bwn" .Cd "device bwn" +.Cd "device bhnd" +.Cd "device bhndb" +.Cd "device bhndb_pci" +.Cd "device bcma" +.Cd "device siba" +.Cd "device gpio" .Cd "device wlan" .Cd "device wlan_amrr" .Cd "device firmware" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +To load the driver as a module at boot, add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent if_bwn_load="YES" @@ -122,9 +125,6 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.bwn.msi_disable -This tunable disables MSI support on the hardware. -The default value is 0. .It Va hw.bwn.usedma This tunable enables DMA operations on the hardware. If the value is 0, PIO mode would be used. @@ -132,10 +132,14 @@ The default value is 1. .El .Sh SEE ALSO .Xr arp 4 , +.Xr bcma 4 , +.Xr bhnd 4 , +.Xr bhndb 4 , .Xr bwi 4 , .Xr cardbus 4 , .Xr intro 4 , .Xr pci 4 , +.Xr siba 4 , .Xr wlan 4 , .Xr wlan_amrr 4 , .Xr ifconfig 8 , @@ -145,12 +149,20 @@ The .Nm driver first appeared in .Fx 8.1 . +The driver was updated to support the common Broadcom +.Xr bhnd 4 +bus interface in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . +Support for +.Xr bhnd 4 +was added by +.An Landon Fuller Aq Mt landonf@FreeBSD.org . .\".Sh BUGS .\"Some card based on the BCM4306 and BCM4309 chips do not work properly .\"on channel 1, 2 and 3. Modified: user/markj/netdump/share/man/man7/arch.7 ============================================================================== --- user/markj/netdump/share/man/man7/arch.7 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/man/man7/arch.7 Wed Feb 7 19:53:14 2018 (r328993) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2018 +.Dd February 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -416,7 +416,7 @@ imply little endian. If we ever were to support the so-called x32 ABI (using 32-bit pointers on the amd64 architecture), it would most likely be encoded as amd64-x32. -It is unfortunate that amd64 speifies the 64-bit evolution of the x86 +It is unfortunate that amd64 specifies the 64-bit evolution of the x86 platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. Modified: user/markj/netdump/share/man/man8/rc.subr.8 ============================================================================== --- user/markj/netdump/share/man/man8/rc.subr.8 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/man/man8/rc.subr.8 Wed Feb 7 19:53:14 2018 (r328993) @@ -551,7 +551,7 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to +This will be passed as arguments to the .Xr env 1 utility. .It Va ${name}_fib @@ -583,6 +583,13 @@ as. Only supported after .Pa /usr is mounted. +.It Va ${name}_limits +.Xr limits 1 +to apply to +.Va command . +This will be passed as arguments to the +.Xr limits 1 +utility. .It Va ${name}_oomprotect .Xr protect 1 .Va command Modified: user/markj/netdump/share/man/man9/bus_map_resource.9 ============================================================================== --- user/markj/netdump/share/man/man9/bus_map_resource.9 Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/man/man9/bus_map_resource.9 Wed Feb 7 19:53:14 2018 (r328993) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd February 5, 2018 .Dt BUS_MAP_RESOURCE 9 .Os .Sh NAME @@ -143,16 +143,16 @@ reads the first 32-bit word: .Bd -literal struct resource *r; struct resource_map map; - struct resource_map_args args; + struct resource_map_request req; uint32_t val; int rid; rid = PCIR_BAR(0); r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_UNMAPPED); - resource_init_map_request(&args); - args.memattr = VM_MEMATTR_WRITE_COMBINING; - bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); + resource_init_map_request(&req); + req.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &req, &map); val = bus_read_4(&map, 0); .Ed .Sh SEE ALSO Modified: user/markj/netdump/share/mk/bsd.compiler.mk ============================================================================== --- user/markj/netdump/share/mk/bsd.compiler.mk Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/mk/bsd.compiler.mk Wed Feb 7 19:53:14 2018 (r328993) @@ -19,7 +19,9 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # -# - c++11 : supports full (or nearly full) C++11 programming environment. +# - c++11: supports full (or nearly full) C++11 programming environment. +# - retpoline: supports the retpoline speculative execution vulnerability +# mitigation. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -178,11 +180,13 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif .endif +${X_}COMPILER_FEATURES= .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES= c++11 -.else -${X_}COMPILER_FEATURES= +${X_}COMPILER_FEATURES+= c++11 +.endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= retpoline .endif .else Modified: user/markj/netdump/share/mk/bsd.linker.mk ============================================================================== --- user/markj/netdump/share/mk/bsd.linker.mk Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/mk/bsd.linker.mk Wed Feb 7 19:53:14 2018 (r328993) @@ -12,7 +12,9 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id : support for generating a Build-ID note +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation # # These variables with an X_ prefix will also be provided if XLD is set. # @@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+= build-id .endif .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter +.endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= retpoline .endif .endif .else Modified: user/markj/netdump/share/mk/src.libnames.mk ============================================================================== --- user/markj/netdump/share/mk/src.libnames.mk Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/mk/src.libnames.mk Wed Feb 7 19:53:14 2018 (r328993) @@ -44,7 +44,6 @@ _INTERNALLIBS= \ parse \ pe \ pmcstat \ - readline \ sl \ sm \ smdb \ @@ -147,7 +146,6 @@ _LIBRARIES= \ procstat \ pthread \ radius \ - readline \ regex \ roken \ rpcsec_gss \ @@ -290,7 +288,6 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_readline= ncursesw _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken @@ -413,9 +410,6 @@ LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBPEDIR= ${OBJTOP}/lib/libpe LIBPE?= ${LIBPEDIR}/libpe.a - -LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline -LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a Modified: user/markj/netdump/share/zoneinfo/Makefile ============================================================================== --- user/markj/netdump/share/zoneinfo/Makefile Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/share/zoneinfo/Makefile Wed Feb 7 19:53:14 2018 (r328993) @@ -95,8 +95,13 @@ zoneinfo: yearistype ${TDATA} zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \ ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES} +# +# Sort TZS to ensure they are the same every build. find -s might +# be a shorter way to express this, but it's non-portable. Any +# differences between the two don't matter for this purpose. +# .if make(*install*) -TZS!= cd ${TZBUILDDIR} && find -s * -type f +TZS!= cd ${TZBUILDDIR} && find * -type f | env LC_ALL=C sort .endif beforeinstall: install-zoneinfo Modified: user/markj/netdump/stand/common/load_elf_obj.c ============================================================================== --- user/markj/netdump/stand/common/load_elf_obj.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/stand/common/load_elf_obj.c Wed Feb 7 19:53:14 2018 (r328993) @@ -282,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: user/markj/netdump/stand/kshim/bsd_kernel.h ============================================================================== --- user/markj/netdump/stand/kshim/bsd_kernel.h Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/stand/kshim/bsd_kernel.h Wed Feb 7 19:53:14 2018 (r328993) @@ -50,6 +50,8 @@ #define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0) #define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1) #define SYSCTL_DECL(...) +struct sysctl_ctx_list { +}; struct sysctl_req { void *newptr; }; @@ -59,6 +61,13 @@ struct sysctl_req { #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_PROC(...) +#define SYSCTL_ADD_NODE(...) NULL +#define SYSCTL_ADD_U16(...) NULL +#define SYSCTL_ADD_PROC(...) NULL +#define sysctl_handle_int(...) EOPNOTSUPP +#define sysctl_handle_string(...) EOPNOTSUPP +#define sysctl_ctx_init(ctx) do { (void)(ctx); } while (0) +#define sysctl_ctx_free(ctx) do { (void)(ctx); } while (0) #define TUNABLE_INT(...) #define MALLOC_DECLARE(...) #define MALLOC_DEFINE(...) @@ -177,6 +186,10 @@ struct uio; struct thread; struct malloc_type; struct usb_process; + +#ifndef INT32_MAX +#define INT32_MAX 0x7fffffff +#endif #ifndef HAVE_STANDARD_DEFS #define _UINT8_T_DECLARED Modified: user/markj/netdump/stand/usb/usbcore.mk ============================================================================== --- user/markj/netdump/stand/usb/usbcore.mk Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/stand/usb/usbcore.mk Wed Feb 7 19:53:14 2018 (r328993) @@ -32,7 +32,7 @@ # USBCOREDIR:= ${.PARSEDIR} -S=${USBCOREDIR}/../.. +S=${USBCOREDIR}/../../sys MACHDEP_DIRS= Modified: user/markj/netdump/sys/amd64/amd64/machdep.c ============================================================================== --- user/markj/netdump/sys/amd64/amd64/machdep.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/amd64/machdep.c Wed Feb 7 19:53:14 2018 (r328993) @@ -282,7 +282,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_free_count())) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -309,8 +309,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: user/markj/netdump/sys/amd64/linux/linux.h ============================================================================== --- user/markj/netdump/sys/amd64/linux/linux.h Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux/linux.h Wed Feb 7 19:53:14 2018 (r328993) @@ -459,7 +459,7 @@ struct l_pollfd { struct linux_robust_list { l_uintptr_t next; }; - + struct linux_robust_list_head { struct linux_robust_list list; l_long futex_offset; Modified: user/markj/netdump/sys/amd64/linux/linux_ptrace.c ============================================================================== --- user/markj/netdump/sys/amd64/linux/linux_ptrace.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux/linux_ptrace.c Wed Feb 7 19:53:14 2018 (r328993) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_TRACEVFORKDONE 32 #define LINUX_PTRACE_O_TRACEEXIT 64 #define LINUX_PTRACE_O_TRACESECCOMP 128 -#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 #define LINUX_NT_PRSTATUS 1 @@ -239,7 +239,7 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, if (data & LINUX_PTRACE_O_TRACEFORK) mask |= PTRACE_FORK; - if (data & LINUX_PTRACE_O_TRACEVFORK) + if (data & LINUX_PTRACE_O_TRACEVFORK) mask |= PTRACE_VFORK; if (data & LINUX_PTRACE_O_TRACECLONE) Modified: user/markj/netdump/sys/amd64/linux/linux_sysvec.c ============================================================================== --- user/markj/netdump/sys/amd64/linux/linux_sysvec.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux/linux_sysvec.c Wed Feb 7 19:53:14 2018 (r328993) @@ -758,7 +758,7 @@ linux_vsyscall(struct thread *td) struct trapframe *frame; uint64_t retqaddr; int code, traced; - int error; + int error; frame = td->td_frame; @@ -832,7 +832,7 @@ linux_vdso_install(void *param) amd64_lower_shared_page(&elf_linux_sysvec); - linux_szsigcode = (&_binary_linux_locore_o_end - + linux_szsigcode = (&_binary_linux_locore_o_end - &_binary_linux_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: user/markj/netdump/sys/amd64/linux/syscalls.master ============================================================================== --- user/markj/netdump/sys/amd64/linux/syscalls.master Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux/syscalls.master Wed Feb 7 19:53:14 2018 (r328993) @@ -76,7 +76,7 @@ l_size_t nbyte, l_loff_t offset); } 18 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ l_size_t nbyte, l_loff_t offset); } -19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ +19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ u_int iovcnt); } 20 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ u_int iovcnt); } @@ -471,10 +471,10 @@ 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ - const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } + const struct l_timespec *times, l_int flags); } +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } @@ -496,10 +496,10 @@ 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } ; linux 2.6.30: -295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ +295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ +296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } ; linux 2.6.31: @@ -551,7 +551,7 @@ void *attr, l_uint size, l_uint flags); } ; linux 3.15: 316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ + const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } ; linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: user/markj/netdump/sys/amd64/linux32/linux.h ============================================================================== --- user/markj/netdump/sys/amd64/linux32/linux.h Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux32/linux.h Wed Feb 7 19:53:14 2018 (r328993) @@ -242,19 +242,19 @@ struct l_stat64 { l_ulonglong st_ino; } __packed; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; } __packed; /* sigaction flags */ @@ -454,11 +454,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_uintptr_t sf_siginfo; + l_uintptr_t sf_siginfo; l_uintptr_t sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; } __packed; /* Modified: user/markj/netdump/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- user/markj/netdump/sys/amd64/linux32/linux32_dummy.c Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux32/linux32_dummy.c Wed Feb 7 19:53:14 2018 (r328993) @@ -8,7 +8,7 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: user/markj/netdump/sys/amd64/linux32/linux32_locore.s ============================================================================== --- user/markj/netdump/sys/amd64/linux32/linux32_locore.s Wed Feb 7 19:49:07 2018 (r328992) +++ user/markj/netdump/sys/amd64/linux32/linux32_locore.s Wed Feb 7 19:53:14 2018 (r328993) @@ -72,12 +72,12 @@ NON_GPROF_ENTRY(linux32_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Thu Feb 8 03:12:26 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3ECDEF3921 for ; Thu, 8 Feb 2018 03:12:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 671526F249; Thu, 8 Feb 2018 03:12:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62153104E0; Thu, 8 Feb 2018 03:12:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w183CQWD011993; Thu, 8 Feb 2018 03:12:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w183CQ8n011992; Thu, 8 Feb 2018 03:12:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802080312.w183CQ8n011992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 8 Feb 2018 03:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r329012 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 329012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 03:12:26 -0000 Author: jeff Date: Thu Feb 8 03:12:25 2018 New Revision: 329012 URL: https://svnweb.freebsd.org/changeset/base/329012 Log: Don't attempt to batch frees for reservation holding objects at all. Don't hold the object lock while doing frees for other objects. Modified: user/jeff/numa/sys/vm/vm_pageout.c Modified: user/jeff/numa/sys/vm/vm_pageout.c ============================================================================== --- user/jeff/numa/sys/vm/vm_pageout.c Thu Feb 8 02:50:47 2018 (r329011) +++ user/jeff/numa/sys/vm/vm_pageout.c Thu Feb 8 03:12:25 2018 (r329012) @@ -1138,11 +1138,9 @@ vm_pageout_free_pages(struct pgo_pglist *pglist, vm_ob pcount = MAX(object->iosize / PAGE_SIZE, 1); count = 0; - if (pcount == 1) { - if (vm_pageout_pglist_append(pglist, m)) - count = 1; + if (pcount == 1 || vm_object_reserv(object)) { + vm_page_free(m); vm_page_unlock(m); - vm_pageout_pglist_flush(pglist, vm_object_reserv(object)); VM_OBJECT_WUNLOCK(object); goto out; } @@ -1189,8 +1187,8 @@ free_page: count++; } mtx_unlock(mtx); - vm_pageout_pglist_flush(pglist, vm_object_reserv(object)); VM_OBJECT_WUNLOCK(object); + vm_pageout_pglist_flush(pglist, false); out: VM_CNT_ADD(v_dfree, count); From owner-svn-src-user@freebsd.org Thu Feb 8 07:52:34 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A4AFF0BC6B for ; Thu, 8 Feb 2018 07:52:34 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F04D1791EF; Thu, 8 Feb 2018 07:52:33 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB1AF1332A; Thu, 8 Feb 2018 07:52:33 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w187qXT2051163; Thu, 8 Feb 2018 07:52:33 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w187qVHJ051135; Thu, 8 Feb 2018 07:52:31 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802080752.w187qVHJ051135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 8 Feb 2018 07:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r329014 - in user/jeff/numa/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in user/jeff/numa/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Commit-Revision: 329014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 07:52:34 -0000 Author: jeff Date: Thu Feb 8 07:52:30 2018 New Revision: 329014 URL: https://svnweb.freebsd.org/changeset/base/329014 Log: Use a per-cpu counter for v_wire_count Modified: user/jeff/numa/sys/amd64/amd64/efirt_machdep.c user/jeff/numa/sys/amd64/amd64/pmap.c user/jeff/numa/sys/amd64/amd64/uma_machdep.c user/jeff/numa/sys/arm/arm/pmap-v6.c user/jeff/numa/sys/arm64/arm64/efirt_machdep.c user/jeff/numa/sys/arm64/arm64/pmap.c user/jeff/numa/sys/arm64/arm64/uma_machdep.c user/jeff/numa/sys/compat/linprocfs/linprocfs.c user/jeff/numa/sys/compat/linux/linux_misc.c user/jeff/numa/sys/i386/i386/pmap.c user/jeff/numa/sys/kern/kern_mib.c user/jeff/numa/sys/kern/subr_pcpu.c user/jeff/numa/sys/kern/vfs_bio.c user/jeff/numa/sys/mips/mips/pmap.c user/jeff/numa/sys/mips/mips/uma_machdep.c user/jeff/numa/sys/powerpc/booke/pmap.c user/jeff/numa/sys/powerpc/powerpc/uma_machdep.c user/jeff/numa/sys/riscv/riscv/pmap.c user/jeff/numa/sys/sparc64/sparc64/pmap.c user/jeff/numa/sys/sparc64/sparc64/vm_machdep.c user/jeff/numa/sys/sys/pmc.h user/jeff/numa/sys/sys/vmmeter.h user/jeff/numa/sys/vm/swap_pager.c user/jeff/numa/sys/vm/vm_glue.c user/jeff/numa/sys/vm/vm_meter.c user/jeff/numa/sys/vm/vm_mmap.c user/jeff/numa/sys/vm/vm_page.c Modified: user/jeff/numa/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- user/jeff/numa/sys/amd64/amd64/efirt_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/amd64/amd64/efirt_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -74,8 +74,8 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + VM_CNT_ADD(v_wire_count, + -obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: user/jeff/numa/sys/amd64/amd64/pmap.c ============================================================================== --- user/jeff/numa/sys/amd64/amd64/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/amd64/amd64/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -2372,7 +2372,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + VM_CNT_ADD(v_wire_count, -count); } /* @@ -2723,8 +2723,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pdp, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -2756,8 +2755,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -2770,9 +2768,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, - 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -2904,14 +2900,12 @@ pmap_release(pmap_t pmap) pmap->pm_pml4[DMPML4I + i] = 0; pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); if (pmap->pm_pml4u != NULL) { m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4u)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free(m); } } @@ -7711,10 +7705,8 @@ pmap_pti_free_page(vm_page_t m) { KASSERT(m->wire_count > 0, ("page %p not wired", m)); - m->wire_count--; - if (m->wire_count != 0) + if (vm_page_unwire(m, PQ_NONE) == false) return (false); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (true); } Modified: user/jeff/numa/sys/amd64/amd64/uma_machdep.c ============================================================================== --- user/jeff/numa/sys/amd64/amd64/uma_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/amd64/amd64/uma_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -74,7 +74,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire(m, PQ_NONE); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: user/jeff/numa/sys/arm/arm/pmap-v6.c ============================================================================== --- user/jeff/numa/sys/arm/arm/pmap-v6.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/arm/arm/pmap-v6.c Thu Feb 8 07:52:30 2018 (r329014) @@ -2634,11 +2634,12 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset_t va, vm_page pmap->pm_stats.resident_count--; /* - * This is a release store so that the ordinary store unmapping + * This barrier is so that the ordinary store unmapping * the L2 page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + wmb(); + VM_CNT_ADD(v_wire_count, -1); } /* @@ -2945,7 +2946,7 @@ out: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); Modified: user/jeff/numa/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- user/jeff/numa/sys/arm64/arm64/efirt_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/arm64/arm64/efirt_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -75,8 +75,8 @@ efi_destroy_1t1_map(void) VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) m->wire_count = 0; - atomic_subtract_int(&vm_cnt.v_wire_count, - obj_1t1_pt->resident_page_count); + VM_CNT_ADD(v_wire_count, + -obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); } Modified: user/jeff/numa/sys/arm64/arm64/pmap.c ============================================================================== --- user/jeff/numa/sys/arm64/arm64/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/arm64/arm64/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1363,11 +1363,12 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t pmap_invalidate_page(pmap, va); /* - * This is a release store so that the ordinary store unmapping + * This barrier is so that the ordinary store unmapping * the page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + wmb(); + VM_CNT_ADD(v_wire_count, -1); /* * Put page on a list so that it is released after @@ -1493,9 +1494,8 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index, lockp) == NULL) { - --m->wire_count; /* XXX: release mem barrier? */ - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -1521,8 +1521,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -1537,10 +1536,8 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; /* XXX: release mem barrier? */ - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -1648,8 +1645,7 @@ pmap_release(pmap_t pmap) m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); } @@ -1919,7 +1915,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); @@ -2276,9 +2272,9 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ pmap_resident_count_dec(pmap, 1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire(ml3, PQ_NONE); pmap_add_delayed_free_list(ml3, free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } return (pmap_unuse_pt(pmap, sva, l1e, free)); } @@ -3723,11 +3719,10 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap,1); KASSERT(ml3->wire_count == NL3PG, ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + ml3->wire_count = 1; + vm_page_unwire(ml3, PQ_NONE); pmap_add_delayed_free_list(ml3, &free, FALSE); - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); } break; case 2: Modified: user/jeff/numa/sys/arm64/arm64/uma_machdep.c ============================================================================== --- user/jeff/numa/sys/arm64/arm64/uma_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/arm64/arm64/uma_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -72,7 +72,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire(m, PQ_NONE); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: user/jeff/numa/sys/compat/linprocfs/linprocfs.c ============================================================================== --- user/jeff/numa/sys/compat/linprocfs/linprocfs.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/compat/linprocfs/linprocfs.c Thu Feb 8 07:52:30 2018 (r329014) @@ -163,7 +163,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * is very little memory left, so we cheat and tell them that * all memory that isn't wired down is free. */ - memused = vm_cnt.v_wire_count * PAGE_SIZE; + memused = vm_wire_count() * PAGE_SIZE; memfree = memtotal - memused; swap_pager_status(&i, &j); swaptotal = (unsigned long long)i * PAGE_SIZE; Modified: user/jeff/numa/sys/compat/linux/linux_misc.c ============================================================================== --- user/jeff/numa/sys/compat/linux/linux_misc.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/compat/linux/linux_misc.c Thu Feb 8 07:52:30 2018 (r329014) @@ -165,7 +165,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - vm_cnt.v_wire_count * PAGE_SIZE; + sysinfo.freeram = sysinfo.totalram - vm_wire_count() * PAGE_SIZE; sysinfo.sharedram = 0; mtx_lock(&vm_object_list_mtx); Modified: user/jeff/numa/sys/i386/i386/pmap.c ============================================================================== --- user/jeff/numa/sys/i386/i386/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/i386/i386/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1718,7 +1718,7 @@ pmap_free_zero_pages(struct spglist *free) /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, count); + VM_CNT_ADD(v_wire_count, -count); } /* @@ -2060,7 +2060,7 @@ pmap_release(pmap_t pmap) m->wire_count--; vm_page_free_zero(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, NPGPTD); + VM_CNT_ADD(v_wire_count, -NPGPTD); } static int Modified: user/jeff/numa/sys/kern/kern_mib.c ============================================================================== --- user/jeff/numa/sys/kern/kern_mib.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/kern/kern_mib.c Thu Feb 8 07:52:30 2018 (r329014) @@ -206,7 +206,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { u_long val; - val = ctob(physmem - vm_cnt.v_wire_count); + val = ctob(physmem - vm_wire_count()); return (sysctl_handle_long(oidp, &val, 0, req)); } Modified: user/jeff/numa/sys/kern/subr_pcpu.c ============================================================================== --- user/jeff/numa/sys/kern/subr_pcpu.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/kern/subr_pcpu.c Thu Feb 8 07:52:30 2018 (r329014) @@ -151,7 +151,7 @@ pcpu_zones_startup(void) pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL); +SYSINIT(pcpu_zones, SI_SUB_VM, SI_ORDER_ANY, pcpu_zones_startup, NULL); /* * First-fit extent based allocator for allocating space in the per-cpu Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/kern/vfs_bio.c Thu Feb 8 07:52:30 2018 (r329014) @@ -4712,7 +4712,7 @@ vm_hold_free_pages(struct buf *bp, int newbsize) p->wire_count--; vm_page_free(p); } - atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages); + VM_CNT_ADD(v_wire_count, -(bp->b_npages - newnpages)); bp->b_npages = newnpages; } Modified: user/jeff/numa/sys/mips/mips/pmap.c ============================================================================== --- user/jeff/numa/sys/mips/mips/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/mips/mips/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1009,7 +1009,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ * If the page is finally unwired, simply free it. */ vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); } /* @@ -1159,8 +1159,7 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int if (_pmap_allocpte(pmap, NUPDE + segindex, flags) == NULL) { /* alloc failed, release current */ - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -1238,8 +1237,7 @@ pmap_release(pmap_t pmap) ptdva = (vm_offset_t)pmap->pm_segtab; ptdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(ptdva)); - ptdpg->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(ptdpg, PQ_NONE); vm_page_free_zero(ptdpg); } Modified: user/jeff/numa/sys/mips/mips/uma_machdep.c ============================================================================== --- user/jeff/numa/sys/mips/mips/uma_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/mips/mips/uma_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -94,7 +94,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = MIPS_DIRECT_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire(m, PQ_NONE); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: user/jeff/numa/sys/powerpc/booke/pmap.c ============================================================================== --- user/jeff/numa/sys/powerpc/booke/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/powerpc/booke/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -681,7 +681,7 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); pmap_kremove(va); } @@ -786,7 +786,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsi ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + VM_CNT_ADD(v_wire_count, -i); return (NULL); } VM_WAIT; @@ -828,7 +828,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); pmap_kremove(va); } @@ -1030,7 +1030,7 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsigned int pdir_i ptbl_free_pmap_ptbl(pmap, ptbl); for (j = 0; j < i; j++) vm_page_free(mtbl[j]); - atomic_subtract_int(&vm_cnt.v_wire_count, i); + VM_CNT_ADD(v_wire_count, -i); return (NULL); } VM_WAIT; @@ -1091,7 +1091,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsigned int pdir_id pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); mmu_booke_kremove(mmu, va); } Modified: user/jeff/numa/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- user/jeff/numa/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -95,8 +95,7 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla (vm_offset_t)mem + PAGE_SIZE); m = PHYS_TO_VM_PAGE((vm_offset_t)mem); - m->wire_count--; + vm_page_unwire(m, PQ_NONE); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); atomic_subtract_int(&hw_uma_mdpages, 1); } Modified: user/jeff/numa/sys/riscv/riscv/pmap.c ============================================================================== --- user/jeff/numa/sys/riscv/riscv/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/riscv/riscv/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1154,11 +1154,12 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t pmap_invalidate_page(pmap, va); /* - * This is a release store so that the ordinary store unmapping + * This barrier is so that the ordinary store unmapping * the page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + wmb(); + VM_CNT_ADD(v_wire_count, -1); /* * Put page on a list so that it is released after @@ -1302,8 +1303,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUPDE + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); return (NULL); } @@ -1388,8 +1388,7 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ Modified: user/jeff/numa/sys/sparc64/sparc64/pmap.c ============================================================================== --- user/jeff/numa/sys/sparc64/sparc64/pmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/sparc64/sparc64/pmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1308,8 +1308,7 @@ pmap_release(pmap_t pm) while (!TAILQ_EMPTY(&obj->memq)) { m = TAILQ_FIRST(&obj->memq); m->md.pmap = NULL; - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire(m, PQ_NONE); vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); Modified: user/jeff/numa/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- user/jeff/numa/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 07:52:30 2018 (r329014) @@ -429,9 +429,8 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla PMAP_STATS_INC(uma_nsmall_free); m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); - m->wire_count--; + vm_page_unwire(m, PQ_NONE); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } void Modified: user/jeff/numa/sys/sys/pmc.h ============================================================================== --- user/jeff/numa/sys/sys/pmc.h Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/sys/pmc.h Thu Feb 8 07:52:30 2018 (r329014) @@ -623,12 +623,12 @@ struct pmc_op_getdyneventinfo { #include -#define PMC_HASH_SIZE 1024 -#define PMC_MTXPOOL_SIZE 2048 -#define PMC_LOG_BUFFER_SIZE 4 -#define PMC_NLOGBUFFERS 1024 -#define PMC_NSAMPLES 1024 -#define PMC_CALLCHAIN_DEPTH 32 +#define PMC_HASH_SIZE 2048 +#define PMC_MTXPOOL_SIZE 4096 +#define PMC_LOG_BUFFER_SIZE 32 +#define PMC_NLOGBUFFERS 32768 +#define PMC_NSAMPLES 4096 +#define PMC_CALLCHAIN_DEPTH 64 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." Modified: user/jeff/numa/sys/sys/vmmeter.h ============================================================================== --- user/jeff/numa/sys/sys/vmmeter.h Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/sys/vmmeter.h Thu Feb 8 07:52:30 2018 (r329014) @@ -125,6 +125,7 @@ struct vmmeter { counter_u64_t v_vforkpages; /* (p) pages affected by vfork() */ counter_u64_t v_rforkpages; /* (p) pages affected by rfork() */ counter_u64_t v_kthreadpages; /* (p) ... and by kernel fork() */ + counter_u64_t v_wire_count; /* (p) pages wired down */ #define VM_METER_NCOUNTERS \ (offsetof(struct vmmeter, v_page_size) / sizeof(counter_u64_t)) /* @@ -139,7 +140,6 @@ struct vmmeter { u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ - u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ }; #endif /* _KERNEL || _WANT_VMMETER */ @@ -156,6 +156,12 @@ extern domainset_t vm_severe_domains; #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) u_int vm_free_count(void); +static inline u_int +vm_wire_count(void) +{ + + return VM_CNT_FETCH(v_wire_count); +} /* * Return TRUE if we are under our severe low-free-pages threshold Modified: user/jeff/numa/sys/vm/swap_pager.c ============================================================================== --- user/jeff/numa/sys/vm/swap_pager.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/vm/swap_pager.c Thu Feb 8 07:52:30 2018 (r329014) @@ -209,7 +209,8 @@ swap_reserve_by_cred(vm_ooffset_t incr, struct ucred * mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { - s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - vm_cnt.v_wire_count; + s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - + vm_wire_count(); s *= PAGE_SIZE; } else s = 0; Modified: user/jeff/numa/sys/vm/vm_glue.c ============================================================================== --- user/jeff/numa/sys/vm/vm_glue.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/vm/vm_glue.c Thu Feb 8 07:52:30 2018 (r329014) @@ -191,7 +191,7 @@ vslock(void *addr, size_t len) * Also, the sysctl code, which is the only present user * of vslock(), does a hard loop on EAGAIN. */ - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, Modified: user/jeff/numa/sys/vm/vm_meter.c ============================================================================== --- user/jeff/numa/sys/vm/vm_meter.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/vm/vm_meter.c Thu Feb 8 07:52:30 2018 (r329014) @@ -96,6 +96,7 @@ struct vmmeter __exclusive_cache_line vm_cnt = { .v_vforkpages = EARLY_COUNTER, .v_rforkpages = EARLY_COUNTER, .v_kthreadpages = EARLY_COUNTER, + .v_wire_count = EARLY_COUNTER, }; static void @@ -105,7 +106,7 @@ vmcounter_startup(void) COUNTER_ARRAY_ALLOC(cnt, VM_METER_NCOUNTERS, M_WAITOK); } -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH + 1, vmcounter_startup, NULL); +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_FIRST, vmcounter_startup, NULL); SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min, CTLFLAG_RW, &vm_cnt.v_free_min, 0, "Minimum low-free-pages threshold"); @@ -403,7 +404,7 @@ VM_STATS_UINT(v_free_reserved, "Pages reserved for dea VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); -VM_STATS_UINT(v_wire_count, "Wired pages"); +VM_STATS_PROC(v_wire_count, "Wired pages", vm_wire_count); VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); Modified: user/jeff/numa/sys/vm/vm_mmap.c ============================================================================== --- user/jeff/numa/sys/vm/vm_mmap.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/vm/vm_mmap.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1002,7 +1002,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + vm_cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_wire_count() > vm_page_max_wired) return (EAGAIN); #ifdef RACCT if (racct_enable) { Modified: user/jeff/numa/sys/vm/vm_page.c ============================================================================== --- user/jeff/numa/sys/vm/vm_page.c Thu Feb 8 05:18:30 2018 (r329013) +++ user/jeff/numa/sys/vm/vm_page.c Thu Feb 8 07:52:30 2018 (r329014) @@ -1848,7 +1848,7 @@ found: * The page lock is not required for wiring a page until that * page is inserted into the object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, 1); m->wire_count = 1; } m->act_count = 0; @@ -1857,7 +1857,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); m->wire_count = 0; } KASSERT(m->object == NULL, ("page %p has object", m)); @@ -2041,7 +2041,7 @@ found: if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); if ((req & VM_ALLOC_WIRED) != 0) - atomic_add_int(&vm_cnt.v_wire_count, npages); + VM_CNT_ADD(v_wire_count, npages); if (object != NULL) { if (object->memattr != VM_MEMATTR_DEFAULT && memattr == VM_MEMATTR_DEFAULT) @@ -2059,8 +2059,7 @@ found: if (vm_page_insert_after(m, object, pindex, mpred)) { pagedaemon_wakeup(domain); if ((req & VM_ALLOC_WIRED) != 0) - atomic_subtract_int( - &vm_cnt.v_wire_count, npages); + VM_CNT_ADD(v_wire_count, -npages); KASSERT(m->object == NULL, ("page %p has object", m)); mpred = m; @@ -2186,7 +2185,7 @@ again: * The page lock is not required for wiring a page that does * not belong to an object. */ - atomic_add_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, 1); m->wire_count = 1; } /* Unmanaged pages don't use "act_count". */ @@ -3405,7 +3404,7 @@ vm_page_wire(vm_page_t m) m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); vm_page_remque(m); - atomic_add_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, 1); } m->wire_count++; KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m)); @@ -3444,7 +3443,7 @@ vm_page_unwire(vm_page_t m, uint8_t queue) if (m->wire_count > 0) { m->wire_count--; if (m->wire_count == 0) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + VM_CNT_ADD(v_wire_count, -1); if ((m->oflags & VPO_UNMANAGED) == 0 && m->object != NULL && queue != PQ_NONE) vm_page_enqueue(queue, m); @@ -4285,7 +4284,7 @@ DB_SHOW_COMMAND(page, vm_page_print_page_info) db_printf("vm_cnt.v_inactive_count: %d\n", vm_inactive_count()); db_printf("vm_cnt.v_active_count: %d\n", vm_active_count()); db_printf("vm_cnt.v_laundry_count: %d\n", vm_laundry_count()); - db_printf("vm_cnt.v_wire_count: %d\n", vm_cnt.v_wire_count); + db_printf("vm_cnt.v_wire_count: %d\n", vm_wire_count()); db_printf("vm_cnt.v_free_reserved: %d\n", vm_cnt.v_free_reserved); db_printf("vm_cnt.v_free_min: %d\n", vm_cnt.v_free_min); db_printf("vm_cnt.v_free_target: %d\n", vm_cnt.v_free_target); From owner-svn-src-user@freebsd.org Thu Feb 8 22:29:55 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB88EF0AD7F for ; Thu, 8 Feb 2018 22:29:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 702BA821B9; Thu, 8 Feb 2018 22:29:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w18MTkBZ022767 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 8 Feb 2018 14:29:47 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w18MTkBZ022766; Thu, 8 Feb 2018 14:29:46 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 8 Feb 2018 14:29:46 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r329014 - in user/jeff/numa/sys: amd64/amd64 arm/arm arm64/arm64 compat/linprocfs compat/linux i386/i386 kern mips/mips powerpc/booke powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm Message-ID: <20180208222946.GQ1063@FreeBSD.org> References: <201802080752.w187qVHJ051135@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802080752.w187qVHJ051135@repo.freebsd.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 22:29:55 -0000 On Thu, Feb 08, 2018 at 07:52:31AM +0000, Jeff Roberson wrote: J> Author: jeff J> Date: Thu Feb 8 07:52:30 2018 J> New Revision: 329014 J> URL: https://svnweb.freebsd.org/changeset/base/329014 J> J> Log: J> Use a per-cpu counter for v_wire_count ... J> -SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH + 1, vmcounter_startup, NULL); J> +SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_FIRST, vmcounter_startup, NULL); Is this enough to get stuff working? When I converted more fields of vmmeter to counter(9), I needed to hardcode vm_meter_startup() call into vm_mem_init(): https://github.com/glebius/FreeBSD/commit/3efe96908c8a8d7f396e9dfc71b91b0a6592b8b7 -- Gleb Smirnoff From owner-svn-src-user@freebsd.org Fri Feb 9 00:38:51 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9953CF13F6E for ; Fri, 9 Feb 2018 00:38:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C08187E9A; Fri, 9 Feb 2018 00:38:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42F861D8A9; Fri, 9 Feb 2018 00:38:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w190cp67064555; Fri, 9 Feb 2018 00:38:51 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w190cprh064554; Fri, 9 Feb 2018 00:38:51 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802090038.w190cprh064554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 9 Feb 2018 00:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r329055 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 329055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2018 00:38:51 -0000 Author: jeff Date: Fri Feb 9 00:38:50 2018 New Revision: 329055 URL: https://svnweb.freebsd.org/changeset/base/329055 Log: Eliminate the use of cmpxchg for bufspace management. This eliminates the time wasted by fighting cmpxchg loops. Modified: user/jeff/numa/sys/kern/vfs_bio.c Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Fri Feb 9 00:36:55 2018 (r329054) +++ user/jeff/numa/sys/kern/vfs_bio.c Fri Feb 9 00:38:50 2018 (r329055) @@ -535,12 +535,12 @@ bufspace_reserve(struct bufdomain *bd, int size, bool limit = bd->bd_maxbufspace; else limit = bd->bd_hibufspace; - do { - space = bd->bd_bufspace; - new = space + size; - if (new > limit) - return (ENOSPC); - } while (atomic_cmpset_long(&bd->bd_bufspace, space, new) == 0); + space = atomic_fetchadd_long(&bd->bd_bufspace, size); + new = space + size; + if (new > limit) { + atomic_subtract_long(&bd->bd_bufspace, size); + return (ENOSPC); + } /* Wake up the daemon on the transition. */ if (space < bd->bd_bufspacethresh && new >= bd->bd_bufspacethresh) From owner-svn-src-user@freebsd.org Sat Feb 10 22:34:47 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 193D6F027E8 for ; Sat, 10 Feb 2018 22:34:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFC2B7607F; Sat, 10 Feb 2018 22:34:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAC051A3B8; Sat, 10 Feb 2018 22:34:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AMYkbg075751; Sat, 10 Feb 2018 22:34:46 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AMYkR2075750; Sat, 10 Feb 2018 22:34:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802102234.w1AMYkR2075750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 10 Feb 2018 22:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r329110 - user/jeff/numa/sys/vm X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/vm X-SVN-Commit-Revision: 329110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Feb 2018 22:34:47 -0000 Author: jeff Date: Sat Feb 10 22:34:46 2018 New Revision: 329110 URL: https://svnweb.freebsd.org/changeset/base/329110 Log: If a segment includes regions that don't produce full reservations due to alignment or size we may find valid rv structures that are not initialized. Don't assert about their contents before we check for a valid object or we will falsely panic when the domain is 0. Thanks to kib for pointing this out to me. Found by: pho Modified: user/jeff/numa/sys/vm/vm_reserv.c Modified: user/jeff/numa/sys/vm/vm_reserv.c ============================================================================== --- user/jeff/numa/sys/vm/vm_reserv.c Sat Feb 10 20:34:09 2018 (r329109) +++ user/jeff/numa/sys/vm/vm_reserv.c Sat Feb 10 22:34:46 2018 (r329110) @@ -1056,9 +1056,9 @@ vm_reserv_free_page(vm_page_t m) vm_reserv_t rv; rv = vm_reserv_from_page(m); - vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); if (rv->object == NULL) return (FALSE); + vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_depopulate(rv, m - rv->pages); return (TRUE); } @@ -1105,9 +1105,9 @@ vm_reserv_is_page_free(vm_page_t m) vm_reserv_t rv; rv = vm_reserv_from_page(m); - vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); if (rv->object == NULL) return (false); + vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); return (popmap_is_clear(rv->popmap, m - rv->pages)); } @@ -1364,18 +1364,14 @@ vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end, vm_page_t vm_reserv_to_superpage(vm_page_t m) { - struct vm_domain *vmd; vm_reserv_t rv; VM_OBJECT_ASSERT_LOCKED(m->object); rv = vm_reserv_from_page(m); - vmd = VM_DOMAIN(rv->domain); - vm_domain_free_lock(vmd); if (rv->object == m->object && rv->popcnt == VM_LEVEL_0_NPAGES) m = rv->pages; else m = NULL; - vm_domain_free_unlock(vmd); return (m); } From owner-svn-src-user@freebsd.org Sat Feb 10 22:35:47 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FA33F0296D for ; Sat, 10 Feb 2018 22:35:47 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA9A376336; Sat, 10 Feb 2018 22:35:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D58911A3BC; Sat, 10 Feb 2018 22:35:46 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AMZkRX075905; Sat, 10 Feb 2018 22:35:46 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AMZkIG075904; Sat, 10 Feb 2018 22:35:46 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802102235.w1AMZkIG075904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 10 Feb 2018 22:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r329112 - user/jeff/numa/sys/kern X-SVN-Group: user X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: user/jeff/numa/sys/kern X-SVN-Commit-Revision: 329112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Feb 2018 22:35:47 -0000 Author: jeff Date: Sat Feb 10 22:35:46 2018 New Revision: 329112 URL: https://svnweb.freebsd.org/changeset/base/329112 Log: Restructure bq_insert so it is not called with a lock held. This allows us to switch locks in this function in certain cases (B_AGE). Found by: pho Modified: user/jeff/numa/sys/kern/vfs_bio.c Modified: user/jeff/numa/sys/kern/vfs_bio.c ============================================================================== --- user/jeff/numa/sys/kern/vfs_bio.c Sat Feb 10 22:34:47 2018 (r329111) +++ user/jeff/numa/sys/kern/vfs_bio.c Sat Feb 10 22:35:46 2018 (r329112) @@ -1009,7 +1009,6 @@ bufinit(void) unmapped_buf = (caddr_t)kva_alloc(MAXPHYS); /* finally, initialize each buffer header and stick on empty q */ - BQ_LOCK(&bqempty); for (i = 0; i < nbuf; i++) { bp = &buf[i]; bzero(bp, sizeof *bp); @@ -1025,7 +1024,6 @@ bufinit(void) BUF_LOCKINIT(bp); bq_insert(&bqempty, bp, false); } - BQ_UNLOCK(&bqempty); /* * maxbufspace is the absolute maximum amount of buffer space we are @@ -1398,9 +1396,7 @@ binsfree(struct buf *bp, int qindex) bq = &bd->bd_cleanq; } else bq = &bqdirty; - BQ_LOCK(bq); bq_insert(bq, bp, true); - BQ_UNLOCK(bq); return; } @@ -1469,12 +1465,21 @@ buf_import(void *arg, void **store, int cnt, int domai static void buf_release(void *arg, void **store, int cnt) { + struct bufqueue *bq; + struct buf *bp; int i; - BQ_LOCK(&bqempty); - for (i = 0; i < cnt; i++) - bq_insert(&bqempty, store[i], false); - BQ_UNLOCK(&bqempty); + bq = &bqempty; + BQ_LOCK(bq); + for (i = 0; i < cnt; i++) { + bp = store[i]; + /* Inline bq_insert() to batch locking. */ + TAILQ_INSERT_TAIL(&bq->bq_queue, bp, b_freelist); + bp->b_flags &= ~(B_AGE | B_REUSE); + bq->bq_len++; + bp->b_qindex = bq->bq_index; + } + BQ_UNLOCK(bq); } /* @@ -1785,26 +1790,32 @@ bq_insert(struct bufqueue *bq, struct buf *bp, bool un { struct bufdomain *bd; - BQ_ASSERT_LOCKED(bq); if (bp->b_qindex != QUEUE_NONE) panic("bq_insert: free buffer %p onto another queue?", bp); bd = &bdclean[bp->b_domain]; if (bp->b_flags & B_AGE) { /* Place this buf directly on the real queue. */ - if (bq->bq_index == QUEUE_CLEAN && bq != &bd->bd_cleanq) { - BQ_LOCK(&bd->bd_cleanq); - BQ_UNLOCK(bq); + if (bq->bq_index == QUEUE_CLEAN) bq = &bd->bd_cleanq; - } + BQ_LOCK(bq); TAILQ_INSERT_HEAD(&bq->bq_queue, bp, b_freelist); - } else + } else { + BQ_LOCK(bq); TAILQ_INSERT_TAIL(&bq->bq_queue, bp, b_freelist); + } bp->b_flags &= ~(B_AGE | B_REUSE); bq->bq_len++; bp->b_qindex = bq->bq_index; bp->b_cpu = bq->bq_cpu; + /* + * Unlock before we notify so that we don't wakeup a waiter that + * fails a trylock on the buf and sleeps again. + */ + if (unlock) + BUF_UNLOCK(bp); + if (bp->b_qindex == QUEUE_CLEAN) { /* * Flush the per-cpu queue and notify any waiters. @@ -1813,13 +1824,7 @@ bq_insert(struct bufqueue *bq, struct buf *bp, bool un bq->bq_len >= bd->bd_lim)) bd_flush(bd, bq); } - - /* - * Unlock before we notify so that we don't wakeup a waiter that - * fails a trylock on the buf and sleeps again. - */ - if (unlock) - BUF_UNLOCK(bp); + BQ_UNLOCK(bq); } /*