Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54710
b: refs/heads/master
c: 4ff773b
h: refs/heads/master
v: v3
  • Loading branch information
Jarek Poplawski authored and Linus Torvalds committed May 8, 2007
1 parent 5f97632 commit 1d6019c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0bb5e19d63cc1b09aed8aef3a20926ac435bb8e7
refs/heads/master: 4ff773bbde87f7f7dddc0f579ad53e077a6587b9
38 changes: 15 additions & 23 deletions trunk/kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ valid_state(struct task_struct *curr, struct held_lock *this,
* Mark a lock with a usage bit, and validate the state transition:
*/
static int mark_lock(struct task_struct *curr, struct held_lock *this,
enum lock_usage_bit new_bit, unsigned long ip)
enum lock_usage_bit new_bit)
{
unsigned int new_mask = 1 << new_bit, ret = 1;

Expand All @@ -1597,14 +1597,6 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,

this->class->usage_mask |= new_mask;

#ifdef CONFIG_TRACE_IRQFLAGS
if (new_bit == LOCK_ENABLED_HARDIRQS ||
new_bit == LOCK_ENABLED_HARDIRQS_READ)
ip = curr->hardirq_enable_ip;
else if (new_bit == LOCK_ENABLED_SOFTIRQS ||
new_bit == LOCK_ENABLED_SOFTIRQS_READ)
ip = curr->softirq_enable_ip;
#endif
if (!save_trace(this->class->usage_traces + new_bit))
return 0;

Expand Down Expand Up @@ -1803,7 +1795,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
* Mark all held locks with a usage bit:
*/
static int
mark_held_locks(struct task_struct *curr, int hardirq, unsigned long ip)
mark_held_locks(struct task_struct *curr, int hardirq)
{
enum lock_usage_bit usage_bit;
struct held_lock *hlock;
Expand All @@ -1823,7 +1815,7 @@ mark_held_locks(struct task_struct *curr, int hardirq, unsigned long ip)
else
usage_bit = LOCK_ENABLED_SOFTIRQS;
}
if (!mark_lock(curr, hlock, usage_bit, ip))
if (!mark_lock(curr, hlock, usage_bit))
return 0;
}

Expand Down Expand Up @@ -1876,15 +1868,15 @@ void trace_hardirqs_on(void)
* We are going to turn hardirqs on, so set the
* usage bit for all held locks:
*/
if (!mark_held_locks(curr, 1, ip))
if (!mark_held_locks(curr, 1))
return;
/*
* If we have softirqs enabled, then set the usage
* bit for all held locks. (disabled hardirqs prevented
* this bit from being set before)
*/
if (curr->softirqs_enabled)
if (!mark_held_locks(curr, 0, ip))
if (!mark_held_locks(curr, 0))
return;

curr->hardirq_enable_ip = ip;
Expand Down Expand Up @@ -1952,7 +1944,7 @@ void trace_softirqs_on(unsigned long ip)
* enabled too:
*/
if (curr->hardirqs_enabled)
mark_held_locks(curr, 0, ip);
mark_held_locks(curr, 0);
}

/*
Expand Down Expand Up @@ -2090,43 +2082,43 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
if (read) {
if (curr->hardirq_context)
if (!mark_lock(curr, hlock,
LOCK_USED_IN_HARDIRQ_READ, ip))
LOCK_USED_IN_HARDIRQ_READ))
return 0;
if (curr->softirq_context)
if (!mark_lock(curr, hlock,
LOCK_USED_IN_SOFTIRQ_READ, ip))
LOCK_USED_IN_SOFTIRQ_READ))
return 0;
} else {
if (curr->hardirq_context)
if (!mark_lock(curr, hlock, LOCK_USED_IN_HARDIRQ, ip))
if (!mark_lock(curr, hlock, LOCK_USED_IN_HARDIRQ))
return 0;
if (curr->softirq_context)
if (!mark_lock(curr, hlock, LOCK_USED_IN_SOFTIRQ, ip))
if (!mark_lock(curr, hlock, LOCK_USED_IN_SOFTIRQ))
return 0;
}
}
if (!hardirqs_off) {
if (read) {
if (!mark_lock(curr, hlock,
LOCK_ENABLED_HARDIRQS_READ, ip))
LOCK_ENABLED_HARDIRQS_READ))
return 0;
if (curr->softirqs_enabled)
if (!mark_lock(curr, hlock,
LOCK_ENABLED_SOFTIRQS_READ, ip))
LOCK_ENABLED_SOFTIRQS_READ))
return 0;
} else {
if (!mark_lock(curr, hlock,
LOCK_ENABLED_HARDIRQS, ip))
LOCK_ENABLED_HARDIRQS))
return 0;
if (curr->softirqs_enabled)
if (!mark_lock(curr, hlock,
LOCK_ENABLED_SOFTIRQS, ip))
LOCK_ENABLED_SOFTIRQS))
return 0;
}
}
#endif
/* mark it as used: */
if (!mark_lock(curr, hlock, LOCK_USED, ip))
if (!mark_lock(curr, hlock, LOCK_USED))
return 0;
out_calc_hash:
/*
Expand Down

0 comments on commit 1d6019c

Please sign in to comment.