spinlock.c (6055aaf87dc835ffdb238f6098110d36b40e3ad3) spinlock.c (3310bbedac497b793b96184e1b9b5da4f747d53a)
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>
7#include <linux/debugfs.h>
8#include <linux/log2.h>

--- 91 unchanged lines hidden (view full) ---

100 __ticket_t want;
101};
102
103static DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
104static DEFINE_PER_CPU(char *, irq_name);
105static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting);
106static cpumask_t waiting_cpus;
107
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>
7#include <linux/debugfs.h>
8#include <linux/log2.h>

--- 91 unchanged lines hidden (view full) ---

100 __ticket_t want;
101};
102
103static DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
104static DEFINE_PER_CPU(char *, irq_name);
105static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting);
106static cpumask_t waiting_cpus;
107
108static bool xen_pvspin __initdata = true;
108static void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
109{
110 int irq = __this_cpu_read(lock_kicker_irq);
111 struct xen_lock_waiting *w = &__get_cpu_var(lock_waiting);
112 int cpu = smp_processor_id();
113 u64 start;
114 unsigned long flags;
115

--- 102 unchanged lines hidden (view full) ---

218 return IRQ_HANDLED;
219}
220
221void xen_init_lock_cpu(int cpu)
222{
223 int irq;
224 char *name;
225
109static void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
110{
111 int irq = __this_cpu_read(lock_kicker_irq);
112 struct xen_lock_waiting *w = &__get_cpu_var(lock_waiting);
113 int cpu = smp_processor_id();
114 u64 start;
115 unsigned long flags;
116

--- 102 unchanged lines hidden (view full) ---

219 return IRQ_HANDLED;
220}
221
222void xen_init_lock_cpu(int cpu)
223{
224 int irq;
225 char *name;
226
227 if (!xen_pvspin)
228 return;
229
226 WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n",
227 cpu, per_cpu(lock_kicker_irq, cpu));
228
229 /*
230 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
231 * (xen: disable PV spinlocks on HVM)
232 */
233 if (xen_hvm_domain())

--- 20 unchanged lines hidden (view full) ---

254{
255 /*
256 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
257 * (xen: disable PV spinlocks on HVM)
258 */
259 if (xen_hvm_domain())
260 return;
261
230 WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n",
231 cpu, per_cpu(lock_kicker_irq, cpu));
232
233 /*
234 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
235 * (xen: disable PV spinlocks on HVM)
236 */
237 if (xen_hvm_domain())

--- 20 unchanged lines hidden (view full) ---

258{
259 /*
260 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
261 * (xen: disable PV spinlocks on HVM)
262 */
263 if (xen_hvm_domain())
264 return;
265
266 if (!xen_pvspin)
267 return;
268
262 unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL);
263 per_cpu(lock_kicker_irq, cpu) = -1;
264 kfree(per_cpu(irq_name, cpu));
265 per_cpu(irq_name, cpu) = NULL;
266}
267
269 unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL);
270 per_cpu(lock_kicker_irq, cpu) = -1;
271 kfree(per_cpu(irq_name, cpu));
272 per_cpu(irq_name, cpu) = NULL;
273}
274
268static bool xen_pvspin __initdata = true;
269
270void __init xen_init_spinlocks(void)
271{
272 /*
273 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
274 * (xen: disable PV spinlocks on HVM)
275 */
276 if (xen_hvm_domain())

--- 23 unchanged lines hidden (view full) ---

300
301static int __init xen_spinlock_debugfs(void)
302{
303 struct dentry *d_xen = xen_init_debugfs();
304
305 if (d_xen == NULL)
306 return -ENOMEM;
307
275
276void __init xen_init_spinlocks(void)
277{
278 /*
279 * See git commit f10cd522c5fbfec9ae3cc01967868c9c2401ed23
280 * (xen: disable PV spinlocks on HVM)
281 */
282 if (xen_hvm_domain())

--- 23 unchanged lines hidden (view full) ---

306
307static int __init xen_spinlock_debugfs(void)
308{
309 struct dentry *d_xen = xen_init_debugfs();
310
311 if (d_xen == NULL)
312 return -ENOMEM;
313
314 if (!xen_pvspin)
315 return 0;
316
308 d_spin_debug = debugfs_create_dir("spinlocks", d_xen);
309
310 debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats);
311
312 debugfs_create_u32("taken_slow", 0444, d_spin_debug,
313 &spinlock_stats.contention_stats[TAKEN_SLOW]);
314 debugfs_create_u32("taken_slow_pickup", 0444, d_spin_debug,
315 &spinlock_stats.contention_stats[TAKEN_SLOW_PICKUP]);

--- 19 unchanged lines hidden ---
317 d_spin_debug = debugfs_create_dir("spinlocks", d_xen);
318
319 debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats);
320
321 debugfs_create_u32("taken_slow", 0444, d_spin_debug,
322 &spinlock_stats.contention_stats[TAKEN_SLOW]);
323 debugfs_create_u32("taken_slow_pickup", 0444, d_spin_debug,
324 &spinlock_stats.contention_stats[TAKEN_SLOW_PICKUP]);

--- 19 unchanged lines hidden ---