[PATCH v4] riscv: Fix permissions for all mm's during mm init

Palmer Dabbelt palmer at rivosinc.com
Sun Sep 18 03:05:47 PDT 2022


On Sat, 17 Sep 2022 11:58:48 PDT (-0700), Linus Torvalds wrote:
> Sorry for html crud, I'm afk right now.
>
> But no, this does not help at all.
>
> Now you're doing a blocking semaphore operation under a spinning rwlock
> instead.
>
> Which also is completely invalid.
>
> Your can't do blocking locks in atomic context, and it doesn't matter
> whether the atomic context is a rcu read section or a spin lock.

OK, sorry for screwing up a second time.  I'll go try and make sure we 
get this right before sending anything up.  Vladimir: I'll just take 
this one over and send a v5, I'll find some time this week to make sure 
I can get it right this time.

Sorry for the mess!

> Stop making random locking changes like this. And enable lockdep and the
> lock verification that would have told you all this immediately.
>
>        Linus
>
>
> On Sat, Sep 17, 2022, 11:48 Vladimir Isaev <vladimir.isaev at syntacore.com>
> wrote:
>
>> );
>> +
>> +       read_lock(&tasklist_lock);
>> +       for_each_process(t) {
>> +               if (t->flags & PF_KTHREAD)
>> +                       continue;
>> +               for_each_thread(t, s) {
>> +                       if (s->mm) {
>> +                               __set_memory_mm(s->mm, start, end,
>> set_mask,
>> +                                               clear_mask);
>> +                       }
>> +               }
>> +       }
>> +       read_unlock(&tasklist_lock);
>>



More information about the linux-riscv mailing list