Skip to content

Commit 2a0a24e

Browse files
committed
sched: Make scheduler_ipi inline
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
1 parent 90b5363 commit 2a0a24e

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

include/linux/sched.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,15 @@ extern char *__get_task_comm(char *to, size_t len, struct task_struct *tsk);
17151715
})
17161716

17171717
#ifdef CONFIG_SMP
1718-
void scheduler_ipi(void);
1718+
static __always_inline void scheduler_ipi(void)
1719+
{
1720+
/*
1721+
* Fold TIF_NEED_RESCHED into the preempt_count; anybody setting
1722+
* TIF_NEED_RESCHED remotely (for the first time) will also send
1723+
* this IPI.
1724+
*/
1725+
preempt_fold_need_resched();
1726+
}
17191727
extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
17201728
#else
17211729
static inline void scheduler_ipi(void) { }

kernel/sched/core.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,16 +2312,6 @@ static void wake_csd_func(void *info)
23122312
sched_ttwu_pending();
23132313
}
23142314

2315-
void scheduler_ipi(void)
2316-
{
2317-
/*
2318-
* Fold TIF_NEED_RESCHED into the preempt_count; anybody setting
2319-
* TIF_NEED_RESCHED remotely (for the first time) will also send
2320-
* this IPI.
2321-
*/
2322-
preempt_fold_need_resched();
2323-
}
2324-
23252315
static void ttwu_queue_remote(struct task_struct *p, int cpu, int wake_flags)
23262316
{
23272317
struct rq *rq = cpu_rq(cpu);

0 commit comments

Comments
 (0)