Print this page
re #13613 rb4516 Tunables needs volatile keyword
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/clock_tick.h
+++ new/usr/src/uts/common/sys/clock_tick.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
|
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 +/*
27 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
28 + */
26 29
27 30 #ifndef _SYS_CLOCK_TICK_H
28 31 #define _SYS_CLOCK_TICK_H
29 32
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 33 #include <sys/types.h>
33 34 #include <sys/mutex.h>
34 35 #include <sys/cpuvar.h>
35 36 #include <sys/systm.h>
36 37 #include <sys/cyclic.h>
37 38
38 39 #ifdef __cplusplus
39 40 extern "C" {
40 41 #endif
41 42
42 43 #define CLOCK_TICK_NCPUS 32
43 44
44 45 /*
45 46 * Per-CPU structure to facilitate multi-threaded tick accounting.
46 47 *
47 48 * ct_lock
48 49 * Mutex for the structure. Used to lock the structure to pass
49 50 * arguments to the tick processing softint handler.
50 51 * ct_intr
51 52 * Tick processing softint handle. For parallelism, each CPU
52 53 * needs to have its own softint handle.
53 54 * ct_lbolt
54 55 * Copy of the lbolt at the time of tick scheduling.
55 56 * ct_pending
56 57 * Number of ticks to be processed by one invocation of the tick
57 58 * processing softint.
58 59 * ct_start
59 60 * First CPU to do tick processing for.
60 61 * ct_end
61 62 * Last CPU to do tick processing for.
62 63 * ct_scan
63 64 * CPU to start the tick processing from. Rotated every tick.
64 65 */
65 66 typedef struct clock_tick_cpu {
66 67 kmutex_t ct_lock;
67 68 ulong_t ct_intr;
68 69 clock_t ct_lbolt;
69 70 int ct_pending;
70 71 int ct_start;
71 72 int ct_end;
72 73 int ct_scan;
73 74 } clock_tick_cpu_t;
74 75
75 76 /*
76 77 * Per-set structure to facilitate multi-threaded tick accounting.
77 78 * clock_tick_lock protects this.
78 79 *
79 80 * ct_start
80 81 * First CPU to do tick processing for.
81 82 * ct_end
82 83 * Last CPU to do tick processing for.
83 84 * ct_scan
84 85 * CPU to start the tick processing from. Rotated every tick.
85 86 */
86 87 typedef struct clock_tick_set {
87 88 int ct_start;
88 89 int ct_end;
89 90 int ct_scan;
90 91 } clock_tick_set_t;
91 92
92 93 #define CLOCK_TICK_CPU_OFFLINE(cp) \
93 94 (((cp) != cpu_active) && ((cp)->cpu_next_onln == (cp)))
94 95
95 96 #define CLOCK_TICK_XCALL_SAFE(cp) \
96 97 CPU_IN_SET(clock_tick_online_cpuset, cp->cpu_id)
97 98
98 99 #define CLOCK_TICK_PROC_MAX 10
99 100
100 101 #ifdef _KERNEL
|
↓ open down ↓ |
59 lines elided |
↑ open up ↑ |
101 102 #pragma weak create_softint
102 103 extern ulong_t create_softint(uint_t, uint_t (*)(caddr_t, caddr_t),
103 104 caddr_t);
104 105 #pragma weak invoke_softint
105 106 extern void invoke_softint(processorid_t, ulong_t);
106 107 #pragma weak sync_softint
107 108 extern void sync_softint(cpuset_t);
108 109 extern void clock_tick(kthread_t *, int);
109 110 extern void membar_sync(void);
110 111
111 -extern int hires_tick;
112 +extern volatile int hires_tick;
112 113 #endif /* _KERNEL */
113 114
114 115 #ifdef __cplusplus
115 116 }
116 117 #endif
117 118
118 119 #endif /* _SYS_CLOCK_TICK_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX