aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2016-09-13 12:37:29 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-22 08:53:45 -0400
commit9af6528ee9b682df7f29dbee86fbba0b67eab944 (patch)
tree4c4d95d0ab025f7d7120694718670efce57488b2 /include/linux/kernel.h
parentbf89a304722f6904009499a31dc68ab9a5c9742e (diff)
sched/core: Optimize __schedule()
Oleg noted that by making do_exit() use __schedule() for the TASK_DEAD context switch, we can avoid the TASK_DEAD special case currently in __schedule() because that avoids the extra preempt_disable() from schedule(). In order to facilitate this, create a do_task_dead() helper which we place in the scheduler code, such that it can access __schedule(). Also add some __noreturn annotations to the functions, there's no coming back from do_exit(). Suggested-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Cheng Chao <cs.os.kernel@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: akpm@linux-foundation.org Cc: chris@chris-wilson.co.uk Cc: tj@kernel.org Link: http://lkml.kernel.org/r/20160913163729.GB5012@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d96a6118d26a..74fd6f05bc5b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -259,17 +259,14 @@ static inline void might_fault(void) { }
259extern struct atomic_notifier_head panic_notifier_list; 259extern struct atomic_notifier_head panic_notifier_list;
260extern long (*panic_blink)(int state); 260extern long (*panic_blink)(int state);
261__printf(1, 2) 261__printf(1, 2)
262void panic(const char *fmt, ...) 262void panic(const char *fmt, ...) __noreturn __cold;
263 __noreturn __cold;
264void nmi_panic(struct pt_regs *regs, const char *msg); 263void nmi_panic(struct pt_regs *regs, const char *msg);
265extern void oops_enter(void); 264extern void oops_enter(void);
266extern void oops_exit(void); 265extern void oops_exit(void);
267void print_oops_end_marker(void); 266void print_oops_end_marker(void);
268extern int oops_may_print(void); 267extern int oops_may_print(void);
269void do_exit(long error_code) 268void do_exit(long error_code) __noreturn;
270 __noreturn; 269void complete_and_exit(struct completion *, long) __noreturn;
271void complete_and_exit(struct completion *, long)
272 __noreturn;
273 270
274/* Internal, do not use. */ 271/* Internal, do not use. */
275int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); 272int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);