Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158116
b: refs/heads/master
c: 98c33ed
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 2, 2009
1 parent 93923f5 commit 62ac934
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 4f84f4330a11b9eb828bf5af557f4c79c64614a3
refs/heads/master: 98c33eddaf41d225d99b40f9eedbd0fac4c08c05
11 changes: 8 additions & 3 deletions trunk/kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,15 +843,18 @@ static int add_lock_to_list(struct lock_class *class, struct lock_class *this,
return 1;
}

/*For good efficiency of modular, we use power of 2*/
/*
* For good efficiency of modular, we use power of 2
*/
#define MAX_CIRCULAR_QUEUE_SIZE 4096UL
#define CQ_MASK (MAX_CIRCULAR_QUEUE_SIZE-1)

/* The circular_queue and helpers is used to implement the
/*
* The circular_queue and helpers is used to implement the
* breadth-first search(BFS)algorithem, by which we can build
* the shortest path from the next lock to be acquired to the
* previous held lock if there is a circular between them.
* */
*/
struct circular_queue {
unsigned long element[MAX_CIRCULAR_QUEUE_SIZE];
unsigned int front, rear;
Expand Down Expand Up @@ -907,6 +910,7 @@ static inline void mark_lock_accessed(struct lock_list *lock,
struct lock_list *parent)
{
unsigned long nr;

nr = lock - list_entries;
WARN_ON(nr >= nr_list_entries);
lock->parent = parent;
Expand All @@ -916,6 +920,7 @@ static inline void mark_lock_accessed(struct lock_list *lock,
static inline unsigned long lock_accessed(struct lock_list *lock)
{
unsigned long nr;

nr = lock - list_entries;
WARN_ON(nr >= nr_list_entries);
return test_bit(nr, bfs_accessed);
Expand Down

0 comments on commit 62ac934

Please sign in to comment.