lkml.org 
[lkml]   [2021]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 11/13] x86/uintr: Introduce uintr_wait() syscall
Date
On Fri, Sep 24 2021 at 13:04, Thomas Gleixner wrote:
> On Mon, Sep 13 2021 at 13:01, Sohil Mehta wrote:
>> +int uintr_receiver_wait(void)
>> +{
>> + struct uintr_upid_ctx *upid_ctx;
>> + unsigned long flags;
>> +
>> + if (!is_uintr_receiver(current))
>> + return -EOPNOTSUPP;
>> +
>> + upid_ctx = current->thread.ui_recv->upid_ctx;
>> + upid_ctx->upid->nc.nv = UINTR_KERNEL_VECTOR;
>> + upid_ctx->waiting = true;
>> + spin_lock_irqsave(&uintr_wait_lock, flags);
>> + list_add(&upid_ctx->node, &uintr_wait_list);
>> + spin_unlock_irqrestore(&uintr_wait_lock, flags);
>> +
>> + set_current_state(TASK_INTERRUPTIBLE);
>
> Because we have not enough properly implemented wait primitives you need
> to open code one which is blantantly wrong vs. a concurrent wake up?
>
>> + schedule();
>
> How is that correct vs. a spurious wakeup? What takes care that the
> entry is removed from the list?
>
> Again. We have proper wait primitives.

Aisde of that this is completely broken vs. CPU hotplug.

CPUX
switchto(tsk)
tsk->upid.ndst = apicid(smp_processor_id();

ret_to_user()
...
sys_uintr_wait()
...
schedule()

After that CPU X is unplugged which means the task won't be woken up by
an user IPI which is issued after CPU X went down.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-09-25 14:09    [W:0.189 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site