[PATCH 5/6] sched: mark should_resched() __always_inline

From: Andi Kleen
Date: Fri Aug 16 2013 - 18:50:57 EST


From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

At least gcc 4.6 and some earlier ones does not inline this function.
Since it's small and on relatively hot paths force inline it.

Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 74d7c04..23df96a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3767,7 +3767,7 @@ SYSCALL_DEFINE0(sched_yield)
return 0;
}

-static inline int should_resched(void)
+static __always_inline int should_resched(void)
{
return need_resched() && !(preempt_count() & PREEMPT_ACTIVE);
}
--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/