1d5de8841SJeremy Fitzhardinge /* 2d5de8841SJeremy Fitzhardinge * Split spinlock implementation out into its own file, so it can be 3d5de8841SJeremy Fitzhardinge * compiled in a FTRACE-compatible way. 4d5de8841SJeremy Fitzhardinge */ 5d5de8841SJeremy Fitzhardinge #include <linux/kernel_stat.h> 6d5de8841SJeremy Fitzhardinge #include <linux/spinlock.h> 7994025caSJeremy Fitzhardinge #include <linux/debugfs.h> 8994025caSJeremy Fitzhardinge #include <linux/log2.h> 95a0e3ad6STejun Heo #include <linux/gfp.h> 10354e7b76SKonrad Rzeszutek Wilk #include <linux/slab.h> 11d5de8841SJeremy Fitzhardinge 12d5de8841SJeremy Fitzhardinge #include <asm/paravirt.h> 13d5de8841SJeremy Fitzhardinge 14d5de8841SJeremy Fitzhardinge #include <xen/interface/xen.h> 15d5de8841SJeremy Fitzhardinge #include <xen/events.h> 16d5de8841SJeremy Fitzhardinge 17d5de8841SJeremy Fitzhardinge #include "xen-ops.h" 18994025caSJeremy Fitzhardinge #include "debugfs.h" 19994025caSJeremy Fitzhardinge 2080bd58feSJeremy Fitzhardinge enum xen_contention_stat { 2180bd58feSJeremy Fitzhardinge TAKEN_SLOW, 2280bd58feSJeremy Fitzhardinge TAKEN_SLOW_PICKUP, 2380bd58feSJeremy Fitzhardinge TAKEN_SLOW_SPURIOUS, 2480bd58feSJeremy Fitzhardinge RELEASED_SLOW, 2580bd58feSJeremy Fitzhardinge RELEASED_SLOW_KICKED, 2680bd58feSJeremy Fitzhardinge NR_CONTENTION_STATS 2780bd58feSJeremy Fitzhardinge }; 2880bd58feSJeremy Fitzhardinge 2980bd58feSJeremy Fitzhardinge 30994025caSJeremy Fitzhardinge #ifdef CONFIG_XEN_DEBUG_FS 3180bd58feSJeremy Fitzhardinge #define HISTO_BUCKETS 30 32994025caSJeremy Fitzhardinge static struct xen_spinlock_stats 33994025caSJeremy Fitzhardinge { 3480bd58feSJeremy Fitzhardinge u32 contention_stats[NR_CONTENTION_STATS]; 35f8eca41fSJeremy Fitzhardinge u32 histo_spin_blocked[HISTO_BUCKETS+1]; 36f8eca41fSJeremy Fitzhardinge u64 time_blocked; 37994025caSJeremy Fitzhardinge } spinlock_stats; 38994025caSJeremy Fitzhardinge 39994025caSJeremy Fitzhardinge static u8 zero_stats; 40994025caSJeremy Fitzhardinge 41994025caSJeremy Fitzhardinge static inline void check_zero(void) 42994025caSJeremy Fitzhardinge { 4380bd58feSJeremy Fitzhardinge u8 ret; 4480bd58feSJeremy Fitzhardinge u8 old = ACCESS_ONCE(zero_stats); 4580bd58feSJeremy Fitzhardinge if (unlikely(old)) { 4680bd58feSJeremy Fitzhardinge ret = cmpxchg(&zero_stats, old, 0); 4780bd58feSJeremy Fitzhardinge /* This ensures only one fellow resets the stat */ 4880bd58feSJeremy Fitzhardinge if (ret == old) 49994025caSJeremy Fitzhardinge memset(&spinlock_stats, 0, sizeof(spinlock_stats)); 50994025caSJeremy Fitzhardinge } 51994025caSJeremy Fitzhardinge } 52994025caSJeremy Fitzhardinge 5380bd58feSJeremy Fitzhardinge static inline void add_stats(enum xen_contention_stat var, u32 val) 5480bd58feSJeremy Fitzhardinge { 5580bd58feSJeremy Fitzhardinge check_zero(); 5680bd58feSJeremy Fitzhardinge spinlock_stats.contention_stats[var] += val; 5780bd58feSJeremy Fitzhardinge } 58994025caSJeremy Fitzhardinge 59994025caSJeremy Fitzhardinge static inline u64 spin_time_start(void) 60994025caSJeremy Fitzhardinge { 61994025caSJeremy Fitzhardinge return xen_clocksource_read(); 62994025caSJeremy Fitzhardinge } 63994025caSJeremy Fitzhardinge 64994025caSJeremy Fitzhardinge static void __spin_time_accum(u64 delta, u32 *array) 65994025caSJeremy Fitzhardinge { 66994025caSJeremy Fitzhardinge unsigned index = ilog2(delta); 67994025caSJeremy Fitzhardinge 68994025caSJeremy Fitzhardinge check_zero(); 69994025caSJeremy Fitzhardinge 70994025caSJeremy Fitzhardinge if (index < HISTO_BUCKETS) 71994025caSJeremy Fitzhardinge array[index]++; 72994025caSJeremy Fitzhardinge else 73994025caSJeremy Fitzhardinge array[HISTO_BUCKETS]++; 74994025caSJeremy Fitzhardinge } 75994025caSJeremy Fitzhardinge 76f8eca41fSJeremy Fitzhardinge static inline void spin_time_accum_blocked(u64 start) 77f8eca41fSJeremy Fitzhardinge { 78f8eca41fSJeremy Fitzhardinge u32 delta = xen_clocksource_read() - start; 79f8eca41fSJeremy Fitzhardinge 80f8eca41fSJeremy Fitzhardinge __spin_time_accum(delta, spinlock_stats.histo_spin_blocked); 81f8eca41fSJeremy Fitzhardinge spinlock_stats.time_blocked += delta; 82994025caSJeremy Fitzhardinge } 83994025caSJeremy Fitzhardinge #else /* !CONFIG_XEN_DEBUG_FS */ 8480bd58feSJeremy Fitzhardinge static inline void add_stats(enum xen_contention_stat var, u32 val) 8580bd58feSJeremy Fitzhardinge { 8680bd58feSJeremy Fitzhardinge } 87994025caSJeremy Fitzhardinge 88994025caSJeremy Fitzhardinge static inline u64 spin_time_start(void) 89994025caSJeremy Fitzhardinge { 90994025caSJeremy Fitzhardinge return 0; 91994025caSJeremy Fitzhardinge } 92994025caSJeremy Fitzhardinge 93f8eca41fSJeremy Fitzhardinge static inline void spin_time_accum_blocked(u64 start) 94994025caSJeremy Fitzhardinge { 95994025caSJeremy Fitzhardinge } 96994025caSJeremy Fitzhardinge #endif /* CONFIG_XEN_DEBUG_FS */ 97d5de8841SJeremy Fitzhardinge 9880bd58feSJeremy Fitzhardinge struct xen_lock_waiting { 9980bd58feSJeremy Fitzhardinge struct arch_spinlock *lock; 10080bd58feSJeremy Fitzhardinge __ticket_t want; 101d5de8841SJeremy Fitzhardinge }; 102d5de8841SJeremy Fitzhardinge 103545ac138SJeremy Fitzhardinge static DEFINE_PER_CPU(int, lock_kicker_irq) = -1; 104354e7b76SKonrad Rzeszutek Wilk static DEFINE_PER_CPU(char *, irq_name); 10580bd58feSJeremy Fitzhardinge static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting); 10680bd58feSJeremy Fitzhardinge static cpumask_t waiting_cpus; 107d5de8841SJeremy Fitzhardinge 108c3b7cb1fSKonrad Rzeszutek Wilk static bool xen_pvspin = true; 109dd41f818SAndi Kleen __visible void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want) 110d5de8841SJeremy Fitzhardinge { 111780f36d8SChristoph Lameter int irq = __this_cpu_read(lock_kicker_irq); 11280bd58feSJeremy Fitzhardinge struct xen_lock_waiting *w = &__get_cpu_var(lock_waiting); 11380bd58feSJeremy Fitzhardinge int cpu = smp_processor_id(); 114f8eca41fSJeremy Fitzhardinge u64 start; 11580bd58feSJeremy Fitzhardinge unsigned long flags; 116d5de8841SJeremy Fitzhardinge 117d5de8841SJeremy Fitzhardinge /* If kicker interrupts not initialized yet, just spin */ 118d5de8841SJeremy Fitzhardinge if (irq == -1) 11980bd58feSJeremy Fitzhardinge return; 120d5de8841SJeremy Fitzhardinge 121f8eca41fSJeremy Fitzhardinge start = spin_time_start(); 122f8eca41fSJeremy Fitzhardinge 12380bd58feSJeremy Fitzhardinge /* 12480bd58feSJeremy Fitzhardinge * Make sure an interrupt handler can't upset things in a 12580bd58feSJeremy Fitzhardinge * partially setup state. 12680bd58feSJeremy Fitzhardinge */ 12780bd58feSJeremy Fitzhardinge local_irq_save(flags); 1281ed7bf5fSJeremy Fitzhardinge /* 1291ed7bf5fSJeremy Fitzhardinge * We don't really care if we're overwriting some other 1301ed7bf5fSJeremy Fitzhardinge * (lock,want) pair, as that would mean that we're currently 1311ed7bf5fSJeremy Fitzhardinge * in an interrupt context, and the outer context had 1321ed7bf5fSJeremy Fitzhardinge * interrupts enabled. That has already kicked the VCPU out 1331ed7bf5fSJeremy Fitzhardinge * of xen_poll_irq(), so it will just return spuriously and 1341ed7bf5fSJeremy Fitzhardinge * retry with newly setup (lock,want). 1351ed7bf5fSJeremy Fitzhardinge * 1361ed7bf5fSJeremy Fitzhardinge * The ordering protocol on this is that the "lock" pointer 1371ed7bf5fSJeremy Fitzhardinge * may only be set non-NULL if the "want" ticket is correct. 1381ed7bf5fSJeremy Fitzhardinge * If we're updating "want", we must first clear "lock". 1391ed7bf5fSJeremy Fitzhardinge */ 1401ed7bf5fSJeremy Fitzhardinge w->lock = NULL; 1411ed7bf5fSJeremy Fitzhardinge smp_wmb(); 14280bd58feSJeremy Fitzhardinge w->want = want; 14380bd58feSJeremy Fitzhardinge smp_wmb(); 14480bd58feSJeremy Fitzhardinge w->lock = lock; 145994025caSJeremy Fitzhardinge 14680bd58feSJeremy Fitzhardinge /* This uses set_bit, which atomic and therefore a barrier */ 14780bd58feSJeremy Fitzhardinge cpumask_set_cpu(cpu, &waiting_cpus); 14880bd58feSJeremy Fitzhardinge add_stats(TAKEN_SLOW, 1); 1494d576b57SJeremy Fitzhardinge 150d5de8841SJeremy Fitzhardinge /* clear pending */ 151d5de8841SJeremy Fitzhardinge xen_clear_irq_pending(irq); 152d5de8841SJeremy Fitzhardinge 15380bd58feSJeremy Fitzhardinge /* Only check lock once pending cleared */ 15480bd58feSJeremy Fitzhardinge barrier(); 15580bd58feSJeremy Fitzhardinge 1561ed7bf5fSJeremy Fitzhardinge /* 1571ed7bf5fSJeremy Fitzhardinge * Mark entry to slowpath before doing the pickup test to make 1581ed7bf5fSJeremy Fitzhardinge * sure we don't deadlock with an unlocker. 1591ed7bf5fSJeremy Fitzhardinge */ 16096f853eaSJeremy Fitzhardinge __ticket_enter_slowpath(lock); 16196f853eaSJeremy Fitzhardinge 1621ed7bf5fSJeremy Fitzhardinge /* 1631ed7bf5fSJeremy Fitzhardinge * check again make sure it didn't become free while 1641ed7bf5fSJeremy Fitzhardinge * we weren't looking 1651ed7bf5fSJeremy Fitzhardinge */ 16680bd58feSJeremy Fitzhardinge if (ACCESS_ONCE(lock->tickets.head) == want) { 16780bd58feSJeremy Fitzhardinge add_stats(TAKEN_SLOW_PICKUP, 1); 168d5de8841SJeremy Fitzhardinge goto out; 169168d2f46SJeremy Fitzhardinge } 1701ed7bf5fSJeremy Fitzhardinge 1711ed7bf5fSJeremy Fitzhardinge /* Allow interrupts while blocked */ 1721ed7bf5fSJeremy Fitzhardinge local_irq_restore(flags); 1731ed7bf5fSJeremy Fitzhardinge 1741ed7bf5fSJeremy Fitzhardinge /* 1751ed7bf5fSJeremy Fitzhardinge * If an interrupt happens here, it will leave the wakeup irq 1761ed7bf5fSJeremy Fitzhardinge * pending, which will cause xen_poll_irq() to return 1771ed7bf5fSJeremy Fitzhardinge * immediately. 1781ed7bf5fSJeremy Fitzhardinge */ 1791ed7bf5fSJeremy Fitzhardinge 18080bd58feSJeremy Fitzhardinge /* Block until irq becomes pending (or perhaps a spurious wakeup) */ 181d5de8841SJeremy Fitzhardinge xen_poll_irq(irq); 18280bd58feSJeremy Fitzhardinge add_stats(TAKEN_SLOW_SPURIOUS, !xen_test_irq_pending(irq)); 1831ed7bf5fSJeremy Fitzhardinge 1841ed7bf5fSJeremy Fitzhardinge local_irq_save(flags); 1851ed7bf5fSJeremy Fitzhardinge 186770144eaSThomas Gleixner kstat_incr_irq_this_cpu(irq); 187d5de8841SJeremy Fitzhardinge out: 18880bd58feSJeremy Fitzhardinge cpumask_clear_cpu(cpu, &waiting_cpus); 18980bd58feSJeremy Fitzhardinge w->lock = NULL; 1901ed7bf5fSJeremy Fitzhardinge 19180bd58feSJeremy Fitzhardinge local_irq_restore(flags); 1921ed7bf5fSJeremy Fitzhardinge 193f8eca41fSJeremy Fitzhardinge spin_time_accum_blocked(start); 194d5de8841SJeremy Fitzhardinge } 195354714ddSJeremy Fitzhardinge PV_CALLEE_SAVE_REGS_THUNK(xen_lock_spinning); 196d5de8841SJeremy Fitzhardinge 19780bd58feSJeremy Fitzhardinge static void xen_unlock_kick(struct arch_spinlock *lock, __ticket_t next) 198d5de8841SJeremy Fitzhardinge { 199d5de8841SJeremy Fitzhardinge int cpu; 200d5de8841SJeremy Fitzhardinge 20180bd58feSJeremy Fitzhardinge add_stats(RELEASED_SLOW, 1); 202994025caSJeremy Fitzhardinge 20380bd58feSJeremy Fitzhardinge for_each_cpu(cpu, &waiting_cpus) { 20480bd58feSJeremy Fitzhardinge const struct xen_lock_waiting *w = &per_cpu(lock_waiting, cpu); 20580bd58feSJeremy Fitzhardinge 2061ed7bf5fSJeremy Fitzhardinge /* Make sure we read lock before want */ 2071ed7bf5fSJeremy Fitzhardinge if (ACCESS_ONCE(w->lock) == lock && 2081ed7bf5fSJeremy Fitzhardinge ACCESS_ONCE(w->want) == next) { 20980bd58feSJeremy Fitzhardinge add_stats(RELEASED_SLOW_KICKED, 1); 210d5de8841SJeremy Fitzhardinge xen_send_IPI_one(cpu, XEN_SPIN_UNLOCK_VECTOR); 21180bd58feSJeremy Fitzhardinge break; 212d5de8841SJeremy Fitzhardinge } 213d5de8841SJeremy Fitzhardinge } 214d5de8841SJeremy Fitzhardinge } 215d5de8841SJeremy Fitzhardinge 216d5de8841SJeremy Fitzhardinge static irqreturn_t dummy_handler(int irq, void *dev_id) 217d5de8841SJeremy Fitzhardinge { 218d5de8841SJeremy Fitzhardinge BUG(); 219d5de8841SJeremy Fitzhardinge return IRQ_HANDLED; 220d5de8841SJeremy Fitzhardinge } 221d5de8841SJeremy Fitzhardinge 222148f9bb8SPaul Gortmaker void xen_init_lock_cpu(int cpu) 223d5de8841SJeremy Fitzhardinge { 224d5de8841SJeremy Fitzhardinge int irq; 225354e7b76SKonrad Rzeszutek Wilk char *name; 226d5de8841SJeremy Fitzhardinge 2273310bbedSKonrad Rzeszutek Wilk if (!xen_pvspin) 2283310bbedSKonrad Rzeszutek Wilk return; 2293310bbedSKonrad Rzeszutek Wilk 230cb91f8f4SKonrad Rzeszutek Wilk WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", 231cb9c6f15SKonrad Rzeszutek Wilk cpu, per_cpu(lock_kicker_irq, cpu)); 232cb9c6f15SKonrad Rzeszutek Wilk 233d5de8841SJeremy Fitzhardinge name = kasprintf(GFP_KERNEL, "spinlock%d", cpu); 234d5de8841SJeremy Fitzhardinge irq = bind_ipi_to_irqhandler(XEN_SPIN_UNLOCK_VECTOR, 235d5de8841SJeremy Fitzhardinge cpu, 236d5de8841SJeremy Fitzhardinge dummy_handler, 2379d71cee6SMichael Opdenacker IRQF_PERCPU|IRQF_NOBALANCING, 238d5de8841SJeremy Fitzhardinge name, 239d5de8841SJeremy Fitzhardinge NULL); 240d5de8841SJeremy Fitzhardinge 241d5de8841SJeremy Fitzhardinge if (irq >= 0) { 242d5de8841SJeremy Fitzhardinge disable_irq(irq); /* make sure it's never delivered */ 243d5de8841SJeremy Fitzhardinge per_cpu(lock_kicker_irq, cpu) = irq; 244354e7b76SKonrad Rzeszutek Wilk per_cpu(irq_name, cpu) = name; 245d5de8841SJeremy Fitzhardinge } 246d5de8841SJeremy Fitzhardinge 247d5de8841SJeremy Fitzhardinge printk("cpu %d spinlock event irq %d\n", cpu, irq); 248d5de8841SJeremy Fitzhardinge } 249d5de8841SJeremy Fitzhardinge 250d68d82afSAlex Nixon void xen_uninit_lock_cpu(int cpu) 251d68d82afSAlex Nixon { 2523310bbedSKonrad Rzeszutek Wilk if (!xen_pvspin) 2533310bbedSKonrad Rzeszutek Wilk return; 2543310bbedSKonrad Rzeszutek Wilk 255d68d82afSAlex Nixon unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL); 256cb9c6f15SKonrad Rzeszutek Wilk per_cpu(lock_kicker_irq, cpu) = -1; 257354e7b76SKonrad Rzeszutek Wilk kfree(per_cpu(irq_name, cpu)); 258354e7b76SKonrad Rzeszutek Wilk per_cpu(irq_name, cpu) = NULL; 259d68d82afSAlex Nixon } 260d68d82afSAlex Nixon 261b8fa70b5SJeremy Fitzhardinge 262a945928eSKonrad Rzeszutek Wilk /* 263a945928eSKonrad Rzeszutek Wilk * Our init of PV spinlocks is split in two init functions due to us 264a945928eSKonrad Rzeszutek Wilk * using paravirt patching and jump labels patching and having to do 265a945928eSKonrad Rzeszutek Wilk * all of this before SMP code is invoked. 266a945928eSKonrad Rzeszutek Wilk * 267a945928eSKonrad Rzeszutek Wilk * The paravirt patching needs to be done _before_ the alternative asm code 268a945928eSKonrad Rzeszutek Wilk * is started, otherwise we would not patch the core kernel code. 269a945928eSKonrad Rzeszutek Wilk */ 270d5de8841SJeremy Fitzhardinge void __init xen_init_spinlocks(void) 271d5de8841SJeremy Fitzhardinge { 27270dd4998SKonrad Rzeszutek Wilk 273b8fa70b5SJeremy Fitzhardinge if (!xen_pvspin) { 274b8fa70b5SJeremy Fitzhardinge printk(KERN_DEBUG "xen: PV spinlocks disabled\n"); 275b8fa70b5SJeremy Fitzhardinge return; 276b8fa70b5SJeremy Fitzhardinge } 277*e0fc17a9SKonrad Rzeszutek Wilk printk(KERN_DEBUG "xen: PV spinlocks enabled\n"); 278354714ddSJeremy Fitzhardinge pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning); 27980bd58feSJeremy Fitzhardinge pv_lock_ops.unlock_kick = xen_unlock_kick; 280d5de8841SJeremy Fitzhardinge } 281994025caSJeremy Fitzhardinge 282a945928eSKonrad Rzeszutek Wilk /* 283a945928eSKonrad Rzeszutek Wilk * While the jump_label init code needs to happend _after_ the jump labels are 284a945928eSKonrad Rzeszutek Wilk * enabled and before SMP is started. Hence we use pre-SMP initcall level 285a945928eSKonrad Rzeszutek Wilk * init. We cannot do it in xen_init_spinlocks as that is done before 286a945928eSKonrad Rzeszutek Wilk * jump labels are activated. 287a945928eSKonrad Rzeszutek Wilk */ 288a945928eSKonrad Rzeszutek Wilk static __init int xen_init_spinlocks_jump(void) 289a945928eSKonrad Rzeszutek Wilk { 290a945928eSKonrad Rzeszutek Wilk if (!xen_pvspin) 291a945928eSKonrad Rzeszutek Wilk return 0; 292a945928eSKonrad Rzeszutek Wilk 293*e0fc17a9SKonrad Rzeszutek Wilk if (!xen_domain()) 294*e0fc17a9SKonrad Rzeszutek Wilk return 0; 295*e0fc17a9SKonrad Rzeszutek Wilk 296a945928eSKonrad Rzeszutek Wilk static_key_slow_inc(¶virt_ticketlocks_enabled); 297a945928eSKonrad Rzeszutek Wilk return 0; 298a945928eSKonrad Rzeszutek Wilk } 299a945928eSKonrad Rzeszutek Wilk early_initcall(xen_init_spinlocks_jump); 300a945928eSKonrad Rzeszutek Wilk 301b8fa70b5SJeremy Fitzhardinge static __init int xen_parse_nopvspin(char *arg) 302b8fa70b5SJeremy Fitzhardinge { 303b8fa70b5SJeremy Fitzhardinge xen_pvspin = false; 304b8fa70b5SJeremy Fitzhardinge return 0; 305b8fa70b5SJeremy Fitzhardinge } 306b8fa70b5SJeremy Fitzhardinge early_param("xen_nopvspin", xen_parse_nopvspin); 307b8fa70b5SJeremy Fitzhardinge 308994025caSJeremy Fitzhardinge #ifdef CONFIG_XEN_DEBUG_FS 309994025caSJeremy Fitzhardinge 310994025caSJeremy Fitzhardinge static struct dentry *d_spin_debug; 311994025caSJeremy Fitzhardinge 312994025caSJeremy Fitzhardinge static int __init xen_spinlock_debugfs(void) 313994025caSJeremy Fitzhardinge { 314994025caSJeremy Fitzhardinge struct dentry *d_xen = xen_init_debugfs(); 315994025caSJeremy Fitzhardinge 316994025caSJeremy Fitzhardinge if (d_xen == NULL) 317994025caSJeremy Fitzhardinge return -ENOMEM; 318994025caSJeremy Fitzhardinge 3193310bbedSKonrad Rzeszutek Wilk if (!xen_pvspin) 3203310bbedSKonrad Rzeszutek Wilk return 0; 3213310bbedSKonrad Rzeszutek Wilk 322994025caSJeremy Fitzhardinge d_spin_debug = debugfs_create_dir("spinlocks", d_xen); 323994025caSJeremy Fitzhardinge 324994025caSJeremy Fitzhardinge debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats); 325994025caSJeremy Fitzhardinge 326994025caSJeremy Fitzhardinge debugfs_create_u32("taken_slow", 0444, d_spin_debug, 32780bd58feSJeremy Fitzhardinge &spinlock_stats.contention_stats[TAKEN_SLOW]); 328994025caSJeremy Fitzhardinge debugfs_create_u32("taken_slow_pickup", 0444, d_spin_debug, 32980bd58feSJeremy Fitzhardinge &spinlock_stats.contention_stats[TAKEN_SLOW_PICKUP]); 330994025caSJeremy Fitzhardinge debugfs_create_u32("taken_slow_spurious", 0444, d_spin_debug, 33180bd58feSJeremy Fitzhardinge &spinlock_stats.contention_stats[TAKEN_SLOW_SPURIOUS]); 332994025caSJeremy Fitzhardinge 333994025caSJeremy Fitzhardinge debugfs_create_u32("released_slow", 0444, d_spin_debug, 33480bd58feSJeremy Fitzhardinge &spinlock_stats.contention_stats[RELEASED_SLOW]); 335994025caSJeremy Fitzhardinge debugfs_create_u32("released_slow_kicked", 0444, d_spin_debug, 33680bd58feSJeremy Fitzhardinge &spinlock_stats.contention_stats[RELEASED_SLOW_KICKED]); 337994025caSJeremy Fitzhardinge 338f8eca41fSJeremy Fitzhardinge debugfs_create_u64("time_blocked", 0444, d_spin_debug, 339f8eca41fSJeremy Fitzhardinge &spinlock_stats.time_blocked); 340994025caSJeremy Fitzhardinge 3419fe2a701SSrivatsa Vaddagiri debugfs_create_u32_array("histo_blocked", 0444, d_spin_debug, 342f8eca41fSJeremy Fitzhardinge spinlock_stats.histo_spin_blocked, HISTO_BUCKETS + 1); 343994025caSJeremy Fitzhardinge 344994025caSJeremy Fitzhardinge return 0; 345994025caSJeremy Fitzhardinge } 346994025caSJeremy Fitzhardinge fs_initcall(xen_spinlock_debugfs); 347994025caSJeremy Fitzhardinge 348994025caSJeremy Fitzhardinge #endif /* CONFIG_XEN_DEBUG_FS */ 349