Skip to content

Commit

Permalink
locking, timer_stats: Annotate table_lock as raw
Browse files Browse the repository at this point in the history
The table_lock lock can be taken in atomic context 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.

Reported-by: Andreas Sundebo <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Andreas Sundebo <[email protected]>

Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
KAGA-KOKO authored and Ingo Molnar committed Sep 13, 2011
1 parent ddb6c9b commit 2737c49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/time/timer_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct entry {
/*
* Spinlock protecting the tables - not taken during lookup:
*/
static DEFINE_SPINLOCK(table_lock);
static DEFINE_RAW_SPINLOCK(table_lock);

/*
* Per-CPU lookup locks for fast hash lookup:
Expand Down Expand Up @@ -188,7 +188,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
prev = NULL;
curr = *head;

spin_lock(&table_lock);
raw_spin_lock(&table_lock);
/*
* Make sure we have not raced with another CPU:
*/
Expand All @@ -215,7 +215,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
*head = curr;
}
out_unlock:
spin_unlock(&table_lock);
raw_spin_unlock(&table_lock);

return curr;
}
Expand Down

0 comments on commit 2737c49

Please sign in to comment.