Re: [PATCH 4.19 057/191] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race

From: Pavel Machek
Date: Thu Nov 05 2020 - 06:44:26 EST


Hi!

> From: Nicholas Piggin <npiggin@xxxxxxxxx>
>
> [ Upstream commit bafb056ce27940c9994ea905336aa8f27b4f7275 ]
...
> io_uring 2b188cc1bb857 ("Add io_uring IO interface") added code which
> does a kthread_use_mm() from a mmget_not_zero() refcount.
...
> The basic fix for sparc64 is to remove its mm_cpumask clearing code. The
> optimisation could be effectively restored by sending IPIs to mm_cpumask
> members and having them remove themselves from mm_cpumask. This is more
> tricky so I leave it as an exercise for someone with a sparc64 SMP.
> powerpc has a (currently similarly broken) example.

So this removes optimalization from Sparc, because it clashes with
2b188cc1bb857 ("Add io_uring IO interface"). But that commit is not
present in 4.19... so this probably is not good idea.

Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek

Attachment: signature.asc
Description: PGP signature