On Wed, Sep 8, 2021 at 6:40 PM Jann Horn <jannh@xxxxxxxxxx> wrote: [...] > I think umcg_idle_loop() should never be called from scheduler > callbacks (meaning umcg_wq_worker_running()), only from UMCG syscalls. I'm moving umcg_wq_worker_running() out of core.c/sched_update_worker() and into /kernel/entry/common.c/exit_to_user_mode_loop() (and will rename the function appropriately). It seems rescheduling/sleeping there is fine. I'm not yet sure if this is all that is needed to deal with UMCG_TF_PREEMPTED flag; but I don't expect to see any locks held when the task truly returns to the userspace. Maybe I'll need to set TIF_NOTIFY_RESUME in sched_update_worker()... [...]