Module Name: src Committed By: ad Date: Fri Dec 27 13:19:25 UTC 2019
Modified Files: src/sys/uvm: uvm.h uvm_page.c Log Message: Nothing uses uvm.cpus any more, and we can do the same with cpu_lookup(), so get rid of it. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/uvm/uvm.h cvs rdiff -u -r1.213 -r1.214 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm.h diff -u src/sys/uvm/uvm.h:1.71 src/sys/uvm/uvm.h:1.72 --- src/sys/uvm/uvm.h:1.71 Fri Dec 27 12:51:57 2019 +++ src/sys/uvm/uvm.h Fri Dec 27 13:19:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm.h,v 1.71 2019/12/27 12:51:57 ad Exp $ */ +/* $NetBSD: uvm.h,v 1.72 2019/12/27 13:19:24 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -78,11 +78,14 @@ struct pgflcache; */ struct uvm_cpu { + /* allocator */ struct pgflcache *pgflcache[VM_NFREELIST];/* cpu-local cached pages */ void *pgflcachemem; /* pointer to allocated mem */ size_t pgflcachememsz; /* size of allocated memory */ u_int pgflcolor; /* next color to allocate */ u_int pgflbucket; /* where to send our pages */ + + /* entropy */ krndsource_t rs; /* entropy source */ }; @@ -109,9 +112,6 @@ struct uvm { /* aio_done is locked by uvm.pagedaemon_lock and splbio! */ TAILQ_HEAD(, buf) aio_done; /* done async i/o reqs */ - - /* per-cpu data */ - struct uvm_cpu *cpus[MAXCPUS]; }; /* Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.213 src/sys/uvm/uvm_page.c:1.214 --- src/sys/uvm/uvm_page.c:1.213 Fri Dec 27 12:51:57 2019 +++ src/sys/uvm/uvm_page.c Fri Dec 27 13:19:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.213 2019/12/27 12:51:57 ad Exp $ */ +/* $NetBSD: uvm_page.c,v 1.214 2019/12/27 13:19:24 ad Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.213 2019/12/27 12:51:57 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.214 2019/12/27 13:19:24 ad Exp $"); #include "opt_ddb.h" #include "opt_uvm.h" @@ -328,7 +328,6 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr * structures). */ - uvm.cpus[0] = &boot_cpu; curcpu()->ci_data.cpu_uvm = &boot_cpu; uvmpdpol_init(); for (b = 0; b < __arraycount(uvm_freelist_locks); b++) { @@ -979,17 +978,17 @@ uvm_cpu_attach(struct cpu_info *ci) KM_SLEEP); ucpu = (struct uvm_cpu *)roundup2((uintptr_t)ucpu, coherency_unit); - uvm.cpus[cpu_index(ci)] = ucpu; ci->ci_data.cpu_uvm = ucpu; + } else { + ucpu = ci->ci_data.cpu_uvm; } /* * Attach RNG source for this CPU's VM events */ - rnd_attach_source(&uvm.cpus[cpu_index(ci)]->rs, - ci->ci_data.cpu_name, RND_TYPE_VM, - RND_FLAG_COLLECT_TIME|RND_FLAG_COLLECT_VALUE| - RND_FLAG_ESTIMATE_VALUE); + rnd_attach_source(&ucpu->rs, ci->ci_data.cpu_name, RND_TYPE_VM, + RND_FLAG_COLLECT_TIME|RND_FLAG_COLLECT_VALUE| + RND_FLAG_ESTIMATE_VALUE); } /*