Skip to content

Commit 757455d

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
locking, latencytop: Annotate latency_lock as raw
The latency_lock is lock can be taken in the guts of the scheduler code and therefore cannot be preempted on -rt - annotate it. In mainline this change documents the low level nature of the lock - otherwise there's no functional difference. Lockdep and Sparse checking will work as usual. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 2737c49 commit 757455d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎kernel/latencytop.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
#include <linux/list.h>
5959
#include <linux/stacktrace.h>
6060

61-
static DEFINE_SPINLOCK(latency_lock);
61+
static DEFINE_RAW_SPINLOCK(latency_lock);
6262

6363
#define MAXLR 128
6464
static struct latency_record latency_record[MAXLR];
@@ -72,19 +72,19 @@ void clear_all_latency_tracing(struct task_struct *p)
7272
if (!latencytop_enabled)
7373
return;
7474

75-
spin_lock_irqsave(&latency_lock, flags);
75+
raw_spin_lock_irqsave(&latency_lock, flags);
7676
memset(&p->latency_record, 0, sizeof(p->latency_record));
7777
p->latency_record_count = 0;
78-
spin_unlock_irqrestore(&latency_lock, flags);
78+
raw_spin_unlock_irqrestore(&latency_lock, flags);
7979
}
8080

8181
static void clear_global_latency_tracing(void)
8282
{
8383
unsigned long flags;
8484

85-
spin_lock_irqsave(&latency_lock, flags);
85+
raw_spin_lock_irqsave(&latency_lock, flags);
8686
memset(&latency_record, 0, sizeof(latency_record));
87-
spin_unlock_irqrestore(&latency_lock, flags);
87+
raw_spin_unlock_irqrestore(&latency_lock, flags);
8888
}
8989

9090
static void __sched
@@ -190,7 +190,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
190190
lat.max = usecs;
191191
store_stacktrace(tsk, &lat);
192192

193-
spin_lock_irqsave(&latency_lock, flags);
193+
raw_spin_lock_irqsave(&latency_lock, flags);
194194

195195
account_global_scheduler_latency(tsk, &lat);
196196

@@ -231,7 +231,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
231231
memcpy(&tsk->latency_record[i], &lat, sizeof(struct latency_record));
232232

233233
out_unlock:
234-
spin_unlock_irqrestore(&latency_lock, flags);
234+
raw_spin_unlock_irqrestore(&latency_lock, flags);
235235
}
236236

237237
static int lstats_show(struct seq_file *m, void *v)

0 commit comments

Comments
 (0)