diff --git a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/sched/core.c b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/sched/core.c index 888c2eddad..8835061ac4 100644 --- a/repos/dde_linux/src/lib/lx_emul/shadow/kernel/sched/core.c +++ b/repos/dde_linux/src/lib/lx_emul/shadow/kernel/sched/core.c @@ -25,6 +25,7 @@ #include #include +#include #include <../kernel/sched/sched.h> @@ -87,7 +88,7 @@ int default_wake_function(wait_queue_entry_t *curr, } -asmlinkage __visible void __sched schedule(void) +static void __schedule(void) { if (preempt_count()) { printk("schedule: unexpected preempt_count=%d\n", preempt_count()); @@ -97,6 +98,26 @@ asmlinkage __visible void __sched schedule(void) lx_emul_task_schedule(current->state != TASK_RUNNING); } +#include "../kernel/workqueue_internal.h" + +asmlinkage __visible void __sched schedule(void) +{ + if (current->state) { + unsigned int task_flags = current->flags; + if (task_flags & PF_WQ_WORKER) { + tick_nohz_idle_enter(); + lx_emul_time_handle(); + tick_nohz_idle_exit(); + wq_worker_sleeping(current); + } + } + + __schedule(); + + if (current->flags & PF_WQ_WORKER) + wq_worker_running(current); +} + #ifdef CONFIG_DEBUG_PREEMPT @@ -119,7 +140,7 @@ asmlinkage __visible void __sched notrace preempt_schedule(void) if (likely(!preemptible())) return; - schedule(); + __schedule(); } @@ -128,7 +149,7 @@ asmlinkage __visible void __sched notrace preempt_schedule_notrace(void) if (likely(!preemptible())) return; - schedule(); + __schedule(); }