sched: Make scheduler_ipi inline
authorThomas Gleixner <tglx@linutronix.de>
Fri, 27 Mar 2020 11:42:00 +0000 (12:42 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 May 2020 15:10:49 +0000 (17:10 +0200)
Now that the scheduler IPI is trivial and simple again there is no point to
have the little function out of line. This simplifies the effort of
constraining the instrumentation nicely.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134058.453581595@linutronix.de
include/linux/sched.h
kernel/sched/core.c

index 4418f5cb832431519edb88c047522c12a816fa3b..d4ea4407cd6d52d13c8fc2ae5197f7dc58701688 100644 (file)
@@ -1715,7 +1715,15 @@ extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
 })
 
 #ifdef CONFIG_SMP
-void scheduler_ipi(void);
+static __always_inline void scheduler_ipi(void)
+{
+       /*
+        * Fold TIF_NEED_RESCHED into the preempt_count; anybody setting
+        * TIF_NEED_RESCHED remotely (for the first time) will also send
+        * this IPI.
+        */
+       preempt_fold_need_resched();
+}
 extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
 #else
 static inline void scheduler_ipi(void) { }
index cd2070d6f1e4a9cf3bc02a1d9475957c76caf4eb..74fb89b5ce3ed225cfbf4d7d9584cb603b7d3486 100644 (file)
@@ -2312,16 +2312,6 @@ static void wake_csd_func(void *info)
        sched_ttwu_pending();
 }
 
-void scheduler_ipi(void)
-{
-       /*
-        * Fold TIF_NEED_RESCHED into the preempt_count; anybody setting
-        * TIF_NEED_RESCHED remotely (for the first time) will also send
-        * this IPI.
-        */
-       preempt_fold_need_resched();
-}
-
 static void ttwu_queue_remote(struct task_struct *p, int cpu, int wake_flags)
 {
        struct rq *rq = cpu_rq(cpu);