Thread (27 messages) flat view 27 messages, 6 authors, 2021-09-15

Re: [PATCH 2/4 v0.5] sched/umcg: RFC: add userspace atomic helpers

From: Jann Horn <jannh@google.com>
Date: 2021-09-09 01:16:51
Also in: lkml

On Thu, Sep 9, 2021 at 1:38 AM Jann Horn [off-list ref] wrote:
On Wed, Sep 8, 2021 at 8:49 PM Peter Oskolkov [off-list ref] wrote:
quoted
Add helper functions to work atomically with userspace 32/64 bit values -
there are some .*futex.* named helpers, but they are not exactly
what is needed for UMCG; I haven't found what else I could use, so I
rolled these.
[...]
You of course won't be able to simply traverse userspace pointers in
such a situation, only access the specific userspace object that
you've prepared beforehand, but luckily it looks like:

 * idle_server_tid_ptr is only accessed in get_idle_server()
   -> which is used from process_waking_worker()
     -> which runs in sleepable context
 * idle_workers_ptr is accessed from:
   -> enqueue_idle_worker
     -> which is also used from process_waking_worker()
Ah, I guess I got that wrong: process_waking_worker() is sleepable,
but it might be holding the mmap lock, so it can't fault, right? Which
means this would actually be problematic...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help