aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-09-26 11:38:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-09-26 11:38:09 -0400
commitd2865c7d4ef818421941579e185c1e4743692f85 (patch)
treefc1fe4b5c46bb059398fab8860360bdbe52f22bb /include/linux
parent8207649c41bf5c28a987be47d66545fa9d2994d8 (diff)
parent03bd4e1f7265548832a76e7919a81f3137c44fd1 (diff)
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar: "A CONFIG_STACK_GROWSUP=y fix, and a hotplug llc CPU mask fix" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Fix unreleased llc_shared_mask bit during CPU hotplug sched: Fix end_of_stack() and location of stack canary for architectures using CONFIG_STACK_GROWSUP
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5c2c885ee52b..1f07040d28e3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2608,9 +2608,22 @@ static inline void setup_thread_stack(struct task_struct *p, struct task_struct
2608 task_thread_info(p)->task = p; 2608 task_thread_info(p)->task = p;
2609} 2609}
2610 2610
2611/*
2612 * Return the address of the last usable long on the stack.
2613 *
2614 * When the stack grows down, this is just above the thread
2615 * info struct. Going any lower will corrupt the threadinfo.
2616 *
2617 * When the stack grows up, this is the highest address.
2618 * Beyond that position, we corrupt data on the next page.
2619 */
2611static inline unsigned long *end_of_stack(struct task_struct *p) 2620static inline unsigned long *end_of_stack(struct task_struct *p)
2612{ 2621{
2622#ifdef CONFIG_STACK_GROWSUP
2623 return (unsigned long *)((unsigned long)task_thread_info(p) + THREAD_SIZE) - 1;
2624#else
2613 return (unsigned long *)(task_thread_info(p) + 1); 2625 return (unsigned long *)(task_thread_info(p) + 1);
2626#endif
2614} 2627}
2615 2628
2616#endif 2629#endif