Messages in this thread | | | From | Jann Horn <> | Date | Thu, 9 Sep 2021 03:16:17 +0200 | Subject | Re: [PATCH 2/4 v0.5] sched/umcg: RFC: add userspace atomic helpers |
| |
On Thu, Sep 9, 2021 at 1:38 AM Jann Horn <jannh@google.com> wrote: > On Wed, Sep 8, 2021 at 8:49 PM Peter Oskolkov <posk@posk.io> wrote: > > 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...
| |