lkml.org 
[lkml]   [2022]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 3/3] sched: User Mode Concurency Groups
On Mon, Jan 17, 2022 at 12:35:29PM +0100, Peter Zijlstra wrote:
> @@ -794,16 +798,31 @@ SYSCALL_DEFINE3(umcg_ctl, u32, flags, st
> UMCG_CTL_WORKER))
> return -EINVAL;
>
> - if (flags == UMCG_CTL_UNREGISTER) {
> - if (self || !current->umcg_task)
> + if (flags & UMCG_CTL_UNREGISTER) {
> + int ret;
> +
> + if (!self || self != current->umcg_task)
> return -EINVAL;
>
> - if (current->flags & PF_UMCG_WORKER) {
> - umcg_worker_exit();
> - // XXX wake server
> - } else
> - umcg_clear_task(current);
> + current->flags &= ~PF_UMCG_WORKER;
>
> + ret = umcg_pin_pages();
> + if (ret) {
> + current->flags |= PF_UMCG_WORKER;
> + return ret;
> + }
> +
> + ret = umcg_update_state(current, self, UMCG_TASK_RUNNING, UMCG_TASK_NONE);
> + if (ret) {
> + current->flags |= PF_UMCG_WORKER;
> + return ret;
> + }

Sorry, should obv only restore PF_UMCG_WORKER for workers.. /me fixes

> +
> + if (current->flags & PF_UMCG_WORKER)
> + umcg_wake(current);
> +
> + umcg_unpin_pages();
> + umcg_clear_task(current);
> return 0;
> }
>

\
 
 \ /
  Last update: 2022-01-17 13:23    [W:0.226 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site