Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Split spinlock implementation out into its own file, so it can be |
| 3 | * compiled in a FTRACE-compatible way. |
| 4 | */ |
| 5 | #include <linux/kernel_stat.h> |
| 6 | #include <linux/spinlock.h> |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 7 | #include <linux/debugfs.h> |
| 8 | #include <linux/log2.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 9 | #include <linux/gfp.h> |
Konrad Rzeszutek Wilk | 354e7b7 | 2013-06-05 10:44:47 -0400 | [diff] [blame] | 10 | #include <linux/slab.h> |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 11 | |
| 12 | #include <asm/paravirt.h> |
| 13 | |
| 14 | #include <xen/interface/xen.h> |
| 15 | #include <xen/events.h> |
| 16 | |
| 17 | #include "xen-ops.h" |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 18 | #include "debugfs.h" |
| 19 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 20 | enum xen_contention_stat { |
| 21 | TAKEN_SLOW, |
| 22 | TAKEN_SLOW_PICKUP, |
| 23 | TAKEN_SLOW_SPURIOUS, |
| 24 | RELEASED_SLOW, |
| 25 | RELEASED_SLOW_KICKED, |
| 26 | NR_CONTENTION_STATS |
| 27 | }; |
| 28 | |
| 29 | |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 30 | #ifdef CONFIG_XEN_DEBUG_FS |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 31 | #define HISTO_BUCKETS 30 |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 32 | static struct xen_spinlock_stats |
| 33 | { |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 34 | u32 contention_stats[NR_CONTENTION_STATS]; |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 35 | u32 histo_spin_blocked[HISTO_BUCKETS+1]; |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 36 | u64 time_blocked; |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 37 | } spinlock_stats; |
| 38 | |
| 39 | static u8 zero_stats; |
| 40 | |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 41 | static inline void check_zero(void) |
| 42 | { |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 43 | u8 ret; |
| 44 | u8 old = ACCESS_ONCE(zero_stats); |
| 45 | if (unlikely(old)) { |
| 46 | ret = cmpxchg(&zero_stats, old, 0); |
| 47 | /* This ensures only one fellow resets the stat */ |
| 48 | if (ret == old) |
| 49 | memset(&spinlock_stats, 0, sizeof(spinlock_stats)); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 50 | } |
| 51 | } |
| 52 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 53 | static inline void add_stats(enum xen_contention_stat var, u32 val) |
| 54 | { |
| 55 | check_zero(); |
| 56 | spinlock_stats.contention_stats[var] += val; |
| 57 | } |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 58 | |
| 59 | static inline u64 spin_time_start(void) |
| 60 | { |
| 61 | return xen_clocksource_read(); |
| 62 | } |
| 63 | |
| 64 | static void __spin_time_accum(u64 delta, u32 *array) |
| 65 | { |
| 66 | unsigned index = ilog2(delta); |
| 67 | |
| 68 | check_zero(); |
| 69 | |
| 70 | if (index < HISTO_BUCKETS) |
| 71 | array[index]++; |
| 72 | else |
| 73 | array[HISTO_BUCKETS]++; |
| 74 | } |
| 75 | |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 76 | static inline void spin_time_accum_blocked(u64 start) |
| 77 | { |
| 78 | u32 delta = xen_clocksource_read() - start; |
| 79 | |
| 80 | __spin_time_accum(delta, spinlock_stats.histo_spin_blocked); |
| 81 | spinlock_stats.time_blocked += delta; |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 82 | } |
| 83 | #else /* !CONFIG_XEN_DEBUG_FS */ |
| 84 | #define TIMEOUT (1 << 10) |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 85 | static inline void add_stats(enum xen_contention_stat var, u32 val) |
| 86 | { |
| 87 | } |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 88 | |
| 89 | static inline u64 spin_time_start(void) |
| 90 | { |
| 91 | return 0; |
| 92 | } |
| 93 | |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 94 | static inline void spin_time_accum_blocked(u64 start) |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 95 | { |
| 96 | } |
| 97 | #endif /* CONFIG_XEN_DEBUG_FS */ |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 98 | |
David Vrabel | 7a7546b | 2012-01-23 19:32:25 +0000 | [diff] [blame] | 99 | /* |
| 100 | * Size struct xen_spinlock so it's the same as arch_spinlock_t. |
| 101 | */ |
| 102 | #if NR_CPUS < 256 |
| 103 | typedef u8 xen_spinners_t; |
| 104 | # define inc_spinners(xl) \ |
| 105 | asm(LOCK_PREFIX " incb %0" : "+m" ((xl)->spinners) : : "memory"); |
| 106 | # define dec_spinners(xl) \ |
| 107 | asm(LOCK_PREFIX " decb %0" : "+m" ((xl)->spinners) : : "memory"); |
| 108 | #else |
| 109 | typedef u16 xen_spinners_t; |
| 110 | # define inc_spinners(xl) \ |
| 111 | asm(LOCK_PREFIX " incw %0" : "+m" ((xl)->spinners) : : "memory"); |
| 112 | # define dec_spinners(xl) \ |
| 113 | asm(LOCK_PREFIX " decw %0" : "+m" ((xl)->spinners) : : "memory"); |
| 114 | #endif |
| 115 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 116 | struct xen_lock_waiting { |
| 117 | struct arch_spinlock *lock; |
| 118 | __ticket_t want; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
Jeremy Fitzhardinge | 545ac13 | 2013-08-09 19:51:49 +0530 | [diff] [blame] | 121 | static DEFINE_PER_CPU(int, lock_kicker_irq) = -1; |
Konrad Rzeszutek Wilk | 354e7b7 | 2013-06-05 10:44:47 -0400 | [diff] [blame] | 122 | static DEFINE_PER_CPU(char *, irq_name); |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 123 | static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting); |
| 124 | static cpumask_t waiting_cpus; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 125 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 126 | static void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want) |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 127 | { |
Christoph Lameter | 780f36d | 2010-12-06 11:16:29 -0600 | [diff] [blame] | 128 | int irq = __this_cpu_read(lock_kicker_irq); |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 129 | struct xen_lock_waiting *w = &__get_cpu_var(lock_waiting); |
| 130 | int cpu = smp_processor_id(); |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 131 | u64 start; |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 132 | unsigned long flags; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 133 | |
| 134 | /* If kicker interrupts not initialized yet, just spin */ |
| 135 | if (irq == -1) |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 136 | return; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 137 | |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 138 | start = spin_time_start(); |
| 139 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 140 | /* |
| 141 | * Make sure an interrupt handler can't upset things in a |
| 142 | * partially setup state. |
| 143 | */ |
| 144 | local_irq_save(flags); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 145 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 146 | w->want = want; |
| 147 | smp_wmb(); |
| 148 | w->lock = lock; |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 149 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 150 | /* This uses set_bit, which atomic and therefore a barrier */ |
| 151 | cpumask_set_cpu(cpu, &waiting_cpus); |
| 152 | add_stats(TAKEN_SLOW, 1); |
Jeremy Fitzhardinge | 4d576b5 | 2009-09-09 12:33:51 -0700 | [diff] [blame] | 153 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 154 | /* clear pending */ |
| 155 | xen_clear_irq_pending(irq); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 156 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 157 | /* Only check lock once pending cleared */ |
| 158 | barrier(); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 159 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 160 | /* check again make sure it didn't become free while |
| 161 | we weren't looking */ |
| 162 | if (ACCESS_ONCE(lock->tickets.head) == want) { |
| 163 | add_stats(TAKEN_SLOW_PICKUP, 1); |
| 164 | goto out; |
| 165 | } |
| 166 | /* Block until irq becomes pending (or perhaps a spurious wakeup) */ |
| 167 | xen_poll_irq(irq); |
| 168 | add_stats(TAKEN_SLOW_SPURIOUS, !xen_test_irq_pending(irq)); |
Thomas Gleixner | d6c88a5 | 2008-10-15 15:27:23 +0200 | [diff] [blame] | 169 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 170 | out: |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 171 | cpumask_clear_cpu(cpu, &waiting_cpus); |
| 172 | w->lock = NULL; |
| 173 | local_irq_restore(flags); |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 174 | spin_time_accum_blocked(start); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 177 | static void xen_unlock_kick(struct arch_spinlock *lock, __ticket_t next) |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 178 | { |
| 179 | int cpu; |
| 180 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 181 | add_stats(RELEASED_SLOW, 1); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 182 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 183 | for_each_cpu(cpu, &waiting_cpus) { |
| 184 | const struct xen_lock_waiting *w = &per_cpu(lock_waiting, cpu); |
| 185 | |
| 186 | if (w->lock == lock && w->want == next) { |
| 187 | add_stats(RELEASED_SLOW_KICKED, 1); |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 188 | xen_send_IPI_one(cpu, XEN_SPIN_UNLOCK_VECTOR); |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 189 | break; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 194 | static irqreturn_t dummy_handler(int irq, void *dev_id) |
| 195 | { |
| 196 | BUG(); |
| 197 | return IRQ_HANDLED; |
| 198 | } |
| 199 | |
Paul Gortmaker | 148f9bb | 2013-06-18 18:23:59 -0400 | [diff] [blame] | 200 | void xen_init_lock_cpu(int cpu) |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 201 | { |
| 202 | int irq; |
Konrad Rzeszutek Wilk | 354e7b7 | 2013-06-05 10:44:47 -0400 | [diff] [blame] | 203 | char *name; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 204 | |
Konrad Rzeszutek Wilk | cb91f8f | 2013-05-06 08:33:15 -0400 | [diff] [blame] | 205 | WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", |
Konrad Rzeszutek Wilk | cb9c6f1 | 2013-04-16 14:33:20 -0400 | [diff] [blame] | 206 | cpu, per_cpu(lock_kicker_irq, cpu)); |
| 207 | |
Konrad Rzeszutek Wilk | 70dd499 | 2013-04-16 14:34:45 -0400 | [diff] [blame] | 208 | /* |
| 209 | * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23 |
| 210 | * (xen: disable PV spinlocks on HVM) |
| 211 | */ |
| 212 | if (xen_hvm_domain()) |
| 213 | return; |
| 214 | |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 215 | name = kasprintf(GFP_KERNEL, "spinlock%d", cpu); |
| 216 | irq = bind_ipi_to_irqhandler(XEN_SPIN_UNLOCK_VECTOR, |
| 217 | cpu, |
| 218 | dummy_handler, |
| 219 | IRQF_DISABLED|IRQF_PERCPU|IRQF_NOBALANCING, |
| 220 | name, |
| 221 | NULL); |
| 222 | |
| 223 | if (irq >= 0) { |
| 224 | disable_irq(irq); /* make sure it's never delivered */ |
| 225 | per_cpu(lock_kicker_irq, cpu) = irq; |
Konrad Rzeszutek Wilk | 354e7b7 | 2013-06-05 10:44:47 -0400 | [diff] [blame] | 226 | per_cpu(irq_name, cpu) = name; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | printk("cpu %d spinlock event irq %d\n", cpu, irq); |
| 230 | } |
| 231 | |
Alex Nixon | d68d82a | 2008-08-22 11:52:15 +0100 | [diff] [blame] | 232 | void xen_uninit_lock_cpu(int cpu) |
| 233 | { |
Konrad Rzeszutek Wilk | 70dd499 | 2013-04-16 14:34:45 -0400 | [diff] [blame] | 234 | /* |
| 235 | * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23 |
| 236 | * (xen: disable PV spinlocks on HVM) |
| 237 | */ |
| 238 | if (xen_hvm_domain()) |
| 239 | return; |
| 240 | |
Alex Nixon | d68d82a | 2008-08-22 11:52:15 +0100 | [diff] [blame] | 241 | unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL); |
Konrad Rzeszutek Wilk | cb9c6f1 | 2013-04-16 14:33:20 -0400 | [diff] [blame] | 242 | per_cpu(lock_kicker_irq, cpu) = -1; |
Konrad Rzeszutek Wilk | 354e7b7 | 2013-06-05 10:44:47 -0400 | [diff] [blame] | 243 | kfree(per_cpu(irq_name, cpu)); |
| 244 | per_cpu(irq_name, cpu) = NULL; |
Alex Nixon | d68d82a | 2008-08-22 11:52:15 +0100 | [diff] [blame] | 245 | } |
| 246 | |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 247 | void __init xen_init_spinlocks(void) |
| 248 | { |
Konrad Rzeszutek Wilk | 70dd499 | 2013-04-16 14:34:45 -0400 | [diff] [blame] | 249 | /* |
| 250 | * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23 |
| 251 | * (xen: disable PV spinlocks on HVM) |
| 252 | */ |
| 253 | if (xen_hvm_domain()) |
| 254 | return; |
| 255 | |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 256 | pv_lock_ops.lock_spinning = xen_lock_spinning; |
| 257 | pv_lock_ops.unlock_kick = xen_unlock_kick; |
Jeremy Fitzhardinge | d5de884 | 2008-07-23 13:28:58 -0700 | [diff] [blame] | 258 | } |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 259 | |
| 260 | #ifdef CONFIG_XEN_DEBUG_FS |
| 261 | |
| 262 | static struct dentry *d_spin_debug; |
| 263 | |
| 264 | static int __init xen_spinlock_debugfs(void) |
| 265 | { |
| 266 | struct dentry *d_xen = xen_init_debugfs(); |
| 267 | |
| 268 | if (d_xen == NULL) |
| 269 | return -ENOMEM; |
| 270 | |
| 271 | d_spin_debug = debugfs_create_dir("spinlocks", d_xen); |
| 272 | |
| 273 | debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats); |
| 274 | |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 275 | debugfs_create_u32("taken_slow", 0444, d_spin_debug, |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 276 | &spinlock_stats.contention_stats[TAKEN_SLOW]); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 277 | debugfs_create_u32("taken_slow_pickup", 0444, d_spin_debug, |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 278 | &spinlock_stats.contention_stats[TAKEN_SLOW_PICKUP]); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 279 | debugfs_create_u32("taken_slow_spurious", 0444, d_spin_debug, |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 280 | &spinlock_stats.contention_stats[TAKEN_SLOW_SPURIOUS]); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 281 | |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 282 | debugfs_create_u32("released_slow", 0444, d_spin_debug, |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 283 | &spinlock_stats.contention_stats[RELEASED_SLOW]); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 284 | debugfs_create_u32("released_slow_kicked", 0444, d_spin_debug, |
Jeremy Fitzhardinge | 80bd58f | 2013-08-09 19:51:53 +0530 | [diff] [blame^] | 285 | &spinlock_stats.contention_stats[RELEASED_SLOW_KICKED]); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 286 | |
Jeremy Fitzhardinge | f8eca41 | 2008-08-20 17:02:21 -0700 | [diff] [blame] | 287 | debugfs_create_u64("time_blocked", 0444, d_spin_debug, |
| 288 | &spinlock_stats.time_blocked); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 289 | |
Srivatsa Vaddagiri | 9fe2a70 | 2012-03-23 13:36:28 +0530 | [diff] [blame] | 290 | debugfs_create_u32_array("histo_blocked", 0444, d_spin_debug, |
| 291 | spinlock_stats.histo_spin_blocked, HISTO_BUCKETS + 1); |
Jeremy Fitzhardinge | 994025c | 2008-08-20 17:02:19 -0700 | [diff] [blame] | 292 | |
| 293 | return 0; |
| 294 | } |
| 295 | fs_initcall(xen_spinlock_debugfs); |
| 296 | |
| 297 | #endif /* CONFIG_XEN_DEBUG_FS */ |