Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Nothing uses uvm.cpus any more, and we can do the sa...



details:   https://anonhg.NetBSD.org/src/rev/090690ac3477
branches:  trunk
changeset: 1005959:090690ac3477
user:      ad <ad%NetBSD.org@localhost>
date:      Fri Dec 27 13:19:24 2019 +0000

description:
Nothing uses uvm.cpus any more, and we can do the same with cpu_lookup(),
so get rid of it.

diffstat:

 sys/uvm/uvm.h      |   8 ++++----
 sys/uvm/uvm_page.c |  15 +++++++--------
 2 files changed, 11 insertions(+), 12 deletions(-)

diffs (83 lines):

diff -r 1af8d756d405 -r 090690ac3477 sys/uvm/uvm.h
--- a/sys/uvm/uvm.h     Fri Dec 27 13:13:17 2019 +0000
+++ b/sys/uvm/uvm.h     Fri Dec 27 13:19:24 2019 +0000
@@ -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 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 @@
 
        /* 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];
 };
 
 /*
diff -r 1af8d756d405 -r 090690ac3477 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Fri Dec 27 13:13:17 2019 +0000
+++ b/sys/uvm/uvm_page.c        Fri Dec 27 13:19:24 2019 +0000
@@ -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 @@
         * 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 @@
                    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);
 }
 
 /*



Home | Main Index | Thread Index | Old Index