mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
sched: Exclude cond_resched() from nested sleep test
cond_resched() is a preemption point, not strictly a blocking primitive, so exclude it from the ->state test. In particular, preemption preserves task_struct::state. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: tglx@linutronix.de Cc: ilya.dryomov@inktank.com Cc: umgwanakikbuti@gmail.com Cc: oleg@redhat.com Cc: Alex Elder <alex.elder@linaro.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Axel Lin <axel.lin@ingics.com> Cc: Daniel Borkmann <dborkman@redhat.com> Cc: Dave Jones <davej@redhat.com> Cc: Jason Baron <jbaron@akamai.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20140924082242.656559952@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
8eb23b9f35
commit
3427445afd
3 changed files with 15 additions and 6 deletions
|
@ -162,6 +162,7 @@ extern int _cond_resched(void);
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
|
||||
void ___might_sleep(const char *file, int line, int preempt_offset);
|
||||
void __might_sleep(const char *file, int line, int preempt_offset);
|
||||
/**
|
||||
* might_sleep - annotation for functions that can sleep
|
||||
|
@ -177,6 +178,8 @@ extern int _cond_resched(void);
|
|||
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
|
||||
# define sched_annotate_sleep() __set_current_state(TASK_RUNNING)
|
||||
#else
|
||||
static inline void ___might_sleep(const char *file, int line,
|
||||
int preempt_offset) { }
|
||||
static inline void __might_sleep(const char *file, int line,
|
||||
int preempt_offset) { }
|
||||
# define might_sleep() do { might_resched(); } while (0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue