aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index f74d2d7aa605..9af56723c096 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -142,6 +142,11 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
142#ifdef CONFIG_LOCK_STAT 142#ifdef CONFIG_LOCK_STAT
143static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats); 143static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], lock_stats);
144 144
145static inline u64 lockstat_clock(void)
146{
147 return cpu_clock(smp_processor_id());
148}
149
145static int lock_point(unsigned long points[], unsigned long ip) 150static int lock_point(unsigned long points[], unsigned long ip)
146{ 151{
147 int i; 152 int i;
@@ -158,7 +163,7 @@ static int lock_point(unsigned long points[], unsigned long ip)
158 return i; 163 return i;
159} 164}
160 165
161static void lock_time_inc(struct lock_time *lt, s64 time) 166static void lock_time_inc(struct lock_time *lt, u64 time)
162{ 167{
163 if (time > lt->max) 168 if (time > lt->max)
164 lt->max = time; 169 lt->max = time;
@@ -234,12 +239,12 @@ static void put_lock_stats(struct lock_class_stats *stats)
234static void lock_release_holdtime(struct held_lock *hlock) 239static void lock_release_holdtime(struct held_lock *hlock)
235{ 240{
236 struct lock_class_stats *stats; 241 struct lock_class_stats *stats;
237 s64 holdtime; 242 u64 holdtime;
238 243
239 if (!lock_stat) 244 if (!lock_stat)
240 return; 245 return;
241 246
242 holdtime = sched_clock() - hlock->holdtime_stamp; 247 holdtime = lockstat_clock() - hlock->holdtime_stamp;
243 248
244 stats = get_lock_stats(hlock_class(hlock)); 249 stats = get_lock_stats(hlock_class(hlock));
245 if (hlock->read) 250 if (hlock->read)
@@ -578,6 +583,9 @@ static int static_obj(void *obj)
578 if ((addr >= start) && (addr < end)) 583 if ((addr >= start) && (addr < end))
579 return 1; 584 return 1;
580 585
586 if (arch_is_kernel_data(addr))
587 return 1;
588
581#ifdef CONFIG_SMP 589#ifdef CONFIG_SMP
582 /* 590 /*
583 * percpu var? 591 * percpu var?
@@ -2789,7 +2797,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
2789 hlock->references = references; 2797 hlock->references = references;
2790#ifdef CONFIG_LOCK_STAT 2798#ifdef CONFIG_LOCK_STAT
2791 hlock->waittime_stamp = 0; 2799 hlock->waittime_stamp = 0;
2792 hlock->holdtime_stamp = sched_clock(); 2800 hlock->holdtime_stamp = lockstat_clock();
2793#endif 2801#endif
2794 2802
2795 if (check == 2 && !mark_irqflags(curr, hlock)) 2803 if (check == 2 && !mark_irqflags(curr, hlock))
@@ -3319,7 +3327,7 @@ found_it:
3319 if (hlock->instance != lock) 3327 if (hlock->instance != lock)
3320 return; 3328 return;
3321 3329
3322 hlock->waittime_stamp = sched_clock(); 3330 hlock->waittime_stamp = lockstat_clock();
3323 3331
3324 contention_point = lock_point(hlock_class(hlock)->contention_point, ip); 3332 contention_point = lock_point(hlock_class(hlock)->contention_point, ip);
3325 contending_point = lock_point(hlock_class(hlock)->contending_point, 3333 contending_point = lock_point(hlock_class(hlock)->contending_point,
@@ -3342,8 +3350,7 @@ __lock_acquired(struct lockdep_map *lock, unsigned long ip)
3342 struct held_lock *hlock, *prev_hlock; 3350 struct held_lock *hlock, *prev_hlock;
3343 struct lock_class_stats *stats; 3351 struct lock_class_stats *stats;
3344 unsigned int depth; 3352 unsigned int depth;
3345 u64 now; 3353 u64 now, waittime = 0;
3346 s64 waittime = 0;
3347 int i, cpu; 3354 int i, cpu;
3348 3355
3349 depth = curr->lockdep_depth; 3356 depth = curr->lockdep_depth;
@@ -3371,7 +3378,7 @@ found_it:
3371 3378
3372 cpu = smp_processor_id(); 3379 cpu = smp_processor_id();
3373 if (hlock->waittime_stamp) { 3380 if (hlock->waittime_stamp) {
3374 now = sched_clock(); 3381 now = lockstat_clock();
3375 waittime = now - hlock->waittime_stamp; 3382 waittime = now - hlock->waittime_stamp;
3376 hlock->holdtime_stamp = now; 3383 hlock->holdtime_stamp = now;
3377 } 3384 }