Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1422796
| From | WANG Chao <wcwxyz@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3] sched: unlikely corrupted stack end |
| Date | 2016-06-15 11:00 +0200 |
| Message-ID | <rKeQ2-iF-9@gated-at.bofh.it> (permalink) |
| References | <rKen0-6S-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
unlikely() was dropped in commit ce03e4137bb2 ("sched/core: Drop
unlikely behind BUG_ON()"), but commit 29d6455178a0 ("sched: panic on
corrupted stack end") dropped BUG_ON() and called panic directly.
Now we should bring unlikely() back for branch prediction. While we're
at it, it's better and cleaner to add unlikely() to
task_stack_end_corrupted() macro.
Signed-off-by: WANG Chao <wcwxyz@gmail.com>
---
include/linux/sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6e42ada26345..74a02bf30827 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2998,7 +2998,7 @@ static inline unsigned long *end_of_stack(struct task_struct *p)
#endif
#define task_stack_end_corrupted(task) \
- (*(end_of_stack(task)) != STACK_END_MAGIC)
+ (unlikely(*(end_of_stack(task)) != STACK_END_MAGIC))
static inline int object_is_on_stack(void *obj)
{
--
2.9.0
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] sched: unlikely corrupted stack end WANG Chao <wcwxyz@gmail.com> - 2016-06-14 08:50 +0200
Re: [PATCH] sched: unlikely corrupted stack end Ingo Molnar <mingo@kernel.org> - 2016-06-14 09:50 +0200
Re: [PATCH] sched: unlikely corrupted stack end Peter Zijlstra <peterz@infradead.org> - 2016-06-14 10:20 +0200
[PATCH v2] sched: unlikely corrupted stack end WANG Chao <wcwxyz@gmail.com> - 2016-06-14 10:30 +0200
Re: [PATCH v2] sched: unlikely corrupted stack end Ingo Molnar <mingo@kernel.org> - 2016-06-14 11:00 +0200
Re: [PATCH v2] sched: unlikely corrupted stack end WANG Chao <wcwxyz@gmail.com> - 2016-06-14 12:20 +0200
Re: [PATCH v2] sched: unlikely corrupted stack end Ingo Molnar <mingo@kernel.org> - 2016-06-14 12:30 +0200
Re: [PATCH v2] sched: unlikely corrupted stack end WANG Chao <wcwxyz@gmail.com> - 2016-06-14 19:00 +0200
Re: [PATCH v2] sched: unlikely corrupted stack end Ingo Molnar <mingo@kernel.org> - 2016-06-15 10:30 +0200
[PATCH v3] sched: unlikely corrupted stack end WANG Chao <wcwxyz@gmail.com> - 2016-06-15 11:00 +0200
csiph-web