Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257164
b: refs/heads/master
c: d902db1
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Jun 22, 2011
1 parent 0647494 commit d1d8a24
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 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: e8f7c70f44f75c827c04239b0ae5f0068b65b76e
refs/heads/master: d902db1eb60387040fe541573083e47469db50ac
2 changes: 1 addition & 1 deletion trunk/Documentation/DocBook/kernel-hacking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ cond_resched(); /* Will sleep */

<para>
You should always compile your kernel
<symbol>CONFIG_DEBUG_SPINLOCK_SLEEP</symbol> on, and it will warn
<symbol>CONFIG_DEBUG_ATOMIC_SLEEP</symbol> on, and it will warn
you if you break these rules. If you <emphasis>do</emphasis> break
the rules, you will eventually lock up your box.
</para>
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/SubmitChecklist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kernel patches.

12: Has been tested with CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP all simultaneously
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_ATOMIC_SLEEP all simultaneously
enabled.

13: Has been build- and runtime tested with and without CONFIG_SMP and
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/development-process/4.Coding
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ testing purposes. In particular, you should turn on:
- DEBUG_SLAB can find a variety of memory allocation and use errors; it
should be used on most development kernels.

- DEBUG_SPINLOCK, DEBUG_SPINLOCK_SLEEP, and DEBUG_MUTEXES will find a
- DEBUG_SPINLOCK, DEBUG_ATOMIC_SLEEP, and DEBUG_MUTEXES will find a
number of common locking errors.

There are quite a few other debugging options, some of which will be
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/ja_JP/SubmitChecklist
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Linux カーネルパッチ投稿者向けチェックリスト

12: CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, CONFIG_DEBUG_SLAB,
CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_SPINLOCK,
CONFIG_DEBUG_SPINLOCK_SLEEP これら全てを同時に有効にして動作確認を
CONFIG_DEBUG_ATOMIC_SLEEP これら全てを同時に有効にして動作確認を
行ってください。

13: CONFIG_SMP, CONFIG_PREEMPT を有効にした場合と無効にした場合の両方で
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/zh_CN/SubmitChecklist
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Linux

12���Ѿ�ͨ��CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT,
CONFIG_DEBUG_SLAB, CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES,
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_SPINLOCK_SLEEP���ԣ�����ͬʱ��
CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_ATOMIC_SLEEP���ԣ�����ͬʱ��
ʹ�ܡ�

13���Ѿ�����������ʹ�û��߲�ʹ�� CONFIG_SMP �� CONFIG_PREEMPT����ִ��ʱ�䡣
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern int _cond_resched(void);
# define might_resched() do { } while (0)
#endif

#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
void __might_sleep(const char *file, int line, int preempt_offset);
/**
* might_sleep - annotation for functions that can sleep
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8018,7 +8018,7 @@ void __init sched_init(void)
scheduler_running = 1;
}

#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
int nested = (preempt_count() & ~PREEMPT_ACTIVE) + rcu_preempt_depth();
Expand Down
8 changes: 5 additions & 3 deletions trunk/lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,15 @@ config TRACE_IRQFLAGS
Enables hooks to interrupt enabling and disabling for
either tracing or lock debugging.

config DEBUG_SPINLOCK_SLEEP
bool "Spinlock debugging: sleep-inside-spinlock checking"
config DEBUG_ATOMIC_SLEEP
bool "Sleep inside atomic section checking"
select PREEMPT_COUNT
depends on DEBUG_KERNEL
help
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
noisy if they are called inside atomic sections: when a spinlock is
held, inside an rcu read side critical section, inside preempt disabled
sections, inside an interrupt, etc...

config DEBUG_LOCKING_API_SELFTESTS
bool "Locking API boot-time self-tests"
Expand Down

0 comments on commit d1d8a24

Please sign in to comment.