Source-Changes-HG archive

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

[src/trunk]: src/sys Add a kcpuset_t which just includes ourself.



details:   https://anonhg.NetBSD.org/src/rev/b740240a6a4a
branches:  trunk
changeset: 781324:b740240a6a4a
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Sep 01 00:24:43 2012 +0000

description:
Add a kcpuset_t which just includes ourself.
Add a ci_cpuname for convenience

diffstat:

 sys/kern/kern_cpu.c |  10 ++++++++--
 sys/sys/cpu_data.h  |   6 +++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diffs (71 lines):

diff -r 6f009c618e59 -r b740240a6a4a sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c       Sat Sep 01 00:22:13 2012 +0000
+++ b/sys/kern/kern_cpu.c       Sat Sep 01 00:24:43 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_cpu.c,v 1.57 2012/08/29 17:13:21 drochner Exp $   */
+/*     $NetBSD: kern_cpu.c,v 1.58 2012/09/01 00:24:43 matt Exp $       */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.57 2012/08/29 17:13:21 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.58 2012/09/01 00:24:43 matt Exp $");
 
 #include "opt_cpu_ucode.h"
 #include "opt_compat_netbsd.h"
@@ -146,6 +146,12 @@
        ci->ci_index = ncpu;
        kcpuset_set(kcpuset_attached, cpu_index(ci));
 
+       /*
+        * Create a convenience cpuset of just ourselves.
+        */
+       kcpuset_create(&ci->ci_data.cpu_kcpuset, true);
+       kcpuset_set(ci->ci_data.cpu_kcpuset, cpu_index(ci));
+
        CIRCLEQ_INSERT_TAIL(&cpu_queue, ci, ci_data.cpu_qchain);
        TAILQ_INIT(&ci->ci_data.cpu_ld_locks);
        __cpu_simple_lock_init(&ci->ci_data.cpu_ld_lock);
diff -r 6f009c618e59 -r b740240a6a4a sys/sys/cpu_data.h
--- a/sys/sys/cpu_data.h        Sat Sep 01 00:22:13 2012 +0000
+++ b/sys/sys/cpu_data.h        Sat Sep 01 00:24:43 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_data.h,v 1.34 2012/01/29 22:55:40 rmind Exp $      */
+/*     $NetBSD: cpu_data.h,v 1.35 2012/09/01 00:24:44 matt Exp $       */
 
 /*-
  * Copyright (c) 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -42,6 +42,7 @@
 #include <sys/pcu.h>
 #include <sys/percpu_types.h>
 #include <sys/queue.h>
+#include <sys/kcpuset.h>
 
 /*
  * MI per-cpu data
@@ -107,6 +108,7 @@
        uint64_t        cpu_cc_freq;            /* cycle counter frequency */
        int64_t         cpu_cc_skew;            /* counter skew vs cpu0 */
        char            cpu_name[8];            /* eg, "cpu4" */
+       kcpuset_t       *cpu_kcpuset;           /* kcpuset_t of this cpu only */
 };
 
 /* compat definitions */
@@ -114,12 +116,14 @@
 #define        ci_index                ci_data.cpu_index
 #define        ci_biglock_count        ci_data.cpu_biglock_count
 #define        ci_biglock_wanted       ci_data.cpu_biglock_wanted
+#define        ci_cpuname              ci_data.cpu_name
 #define        ci_spin_locks           ci_data.cpu_spin_locks
 #define        ci_simple_locks         ci_data.cpu_simple_locks
 #define        ci_lockstat             ci_data.cpu_lockstat
 #define        ci_spin_locks2          ci_data.cpu_spin_locks2
 #define        ci_lkdebug_recurse      ci_data.cpu_lkdebug_recurse
 #define        ci_pcu_curlwp           ci_data.cpu_pcu_curlwp
+#define        ci_kcpuset              ci_data.cpu_kcpuset
 
 #define        ci_package_id           ci_data.cpu_package_id
 #define        ci_core_id              ci_data.cpu_core_id



Home | Main Index | Thread Index | Old Index