Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178038
b: refs/heads/master
c: 234da7b
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Dec 17, 2009
1 parent 5042689 commit 3be3c3b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 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: 416eb39556a03d1c7e52b0791e9052ccd71db241
refs/heads/master: 234da7bcdc7aaa935846534c3b726dbc79a9cdd5
5 changes: 5 additions & 0 deletions trunk/include/linux/rcutiny.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,9 @@ static inline void exit_rcu(void)
{
}

static inline int rcu_preempt_depth(void)
{
return 0;
}

#endif /* __LINUX_RCUTINY_H */
11 changes: 11 additions & 0 deletions trunk/include/linux/rcutree.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ extern void __rcu_read_unlock(void);
extern void synchronize_rcu(void);
extern void exit_rcu(void);

/*
* Defined as macro as it is a very low level header
* included from areas that don't even know about current
*/
#define rcu_preempt_depth() (current->rcu_read_lock_nesting)

#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */

static inline void __rcu_read_lock(void)
Expand All @@ -63,6 +69,11 @@ static inline void exit_rcu(void)
{
}

static inline int rcu_preempt_depth(void)
{
return 0;
}

#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */

static inline void __rcu_read_lock_bh(void)
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -9682,7 +9682,7 @@ void __init sched_init(void)
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
int nested = preempt_count() & ~PREEMPT_ACTIVE;
int nested = (preempt_count() & ~PREEMPT_ACTIVE) + rcu_preempt_depth();

return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
}
Expand Down

0 comments on commit 3be3c3b

Please sign in to comment.