Commit 0dfea57f authored by Thomas Gleixner's avatar Thomas Gleixner

latencytop: Convert latency_lock to atomic_spinlock

latency_lock is taken in the guts of the scheduler code and needs to
be a real spinlock on RT. convert it to atomic_spinlock.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent cc2fa446
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/stacktrace.h> #include <linux/stacktrace.h>
static DEFINE_SPINLOCK(latency_lock); static DEFINE_ATOMIC_SPINLOCK(latency_lock);
#define MAXLR 128 #define MAXLR 128
static struct latency_record latency_record[MAXLR]; static struct latency_record latency_record[MAXLR];
...@@ -73,19 +73,19 @@ void clear_all_latency_tracing(struct task_struct *p) ...@@ -73,19 +73,19 @@ void clear_all_latency_tracing(struct task_struct *p)
if (!latencytop_enabled) if (!latencytop_enabled)
return; return;
spin_lock_irqsave(&latency_lock, flags); atomic_spin_lock_irqsave(&latency_lock, flags);
memset(&p->latency_record, 0, sizeof(p->latency_record)); memset(&p->latency_record, 0, sizeof(p->latency_record));
p->latency_record_count = 0; p->latency_record_count = 0;
spin_unlock_irqrestore(&latency_lock, flags); atomic_spin_unlock_irqrestore(&latency_lock, flags);
} }
static void clear_global_latency_tracing(void) static void clear_global_latency_tracing(void)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&latency_lock, flags); atomic_spin_lock_irqsave(&latency_lock, flags);
memset(&latency_record, 0, sizeof(latency_record)); memset(&latency_record, 0, sizeof(latency_record));
spin_unlock_irqrestore(&latency_lock, flags); atomic_spin_unlock_irqrestore(&latency_lock, flags);
} }
static void __sched static void __sched
...@@ -191,7 +191,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter) ...@@ -191,7 +191,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
lat.max = usecs; lat.max = usecs;
store_stacktrace(tsk, &lat); store_stacktrace(tsk, &lat);
spin_lock_irqsave(&latency_lock, flags); atomic_spin_lock_irqsave(&latency_lock, flags);
account_global_scheduler_latency(tsk, &lat); account_global_scheduler_latency(tsk, &lat);
...@@ -233,7 +233,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter) ...@@ -233,7 +233,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
memcpy(&tsk->latency_record[i], &lat, sizeof(struct latency_record)); memcpy(&tsk->latency_record[i], &lat, sizeof(struct latency_record));
out_unlock: out_unlock:
spin_unlock_irqrestore(&latency_lock, flags); atomic_spin_unlock_irqrestore(&latency_lock, flags);
} }
static int lstats_show(struct seq_file *m, void *v) static int lstats_show(struct seq_file *m, void *v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment