提交 7d4dd4f1 编写于 作者: D Dominik Brodowski

sched: add do_sched_yield() helper; remove in-kernel call to sched_yield()

Using the sched-internal do_sched_yield() helper allows us to get rid of
the sched-internal call to the sys_sched_yield() syscall.

This patch is part of a series which removes in-kernel calls to syscalls.
On this basis, the syscall entry path can be streamlined. For details, see
http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

Cc: Ingo Molnar <mingo@redhat.com>
Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
上级 e530dca5
...@@ -4892,7 +4892,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len, ...@@ -4892,7 +4892,7 @@ SYSCALL_DEFINE3(sched_getaffinity, pid_t, pid, unsigned int, len,
* *
* Return: 0. * Return: 0.
*/ */
SYSCALL_DEFINE0(sched_yield) static void do_sched_yield(void)
{ {
struct rq_flags rf; struct rq_flags rf;
struct rq *rq; struct rq *rq;
...@@ -4913,7 +4913,11 @@ SYSCALL_DEFINE0(sched_yield) ...@@ -4913,7 +4913,11 @@ SYSCALL_DEFINE0(sched_yield)
sched_preempt_enable_no_resched(); sched_preempt_enable_no_resched();
schedule(); schedule();
}
SYSCALL_DEFINE0(sched_yield)
{
do_sched_yield();
return 0; return 0;
} }
...@@ -4997,7 +5001,7 @@ EXPORT_SYMBOL(__cond_resched_softirq); ...@@ -4997,7 +5001,7 @@ EXPORT_SYMBOL(__cond_resched_softirq);
void __sched yield(void) void __sched yield(void)
{ {
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
sys_sched_yield(); do_sched_yield();
} }
EXPORT_SYMBOL(yield); EXPORT_SYMBOL(yield);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册