lkml.org 
[lkml]   [2021]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [EXTERNAL] [PATCH v2] rcu/nocb: Handle concurrent nocb kthreads creation
From
Date
On Sat, 2021-12-11 at 22:31 +0530, Neeraj Upadhyay wrote:
> When multiple CPUs in the same nocb gp/cb group concurrently
> come online, they might try to concurrently create the same
> rcuog kthread. Fix this by using nocb gp CPU's spawn mutex to
> provide mutual exclusion for the rcuog kthread creation code.
>
> Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
> ---
> Change in v2:
> Fix missing mutex_unlock in nocb gp kthread creation err path.

I think this ends up being not strictly necessary in the short term too
because we aren't currently planning to run rcutree_prepare_cpu()
concurrently anyway. But harmless and worth fixing in the longer term.

Although, if I've already added a mutex for adding the boost thread,
could we manage to use the *same* mutex instead of adding another one?

Acked-by: David Woodhouse <dwmw@amazon.co.uk>
+ mutex_unlock(&rdp_gp->nocb_gp_kthread_mutex);
> return;
> + }
> WRITE_ONCE(rdp_gp->nocb_gp_kthread, t);
> }
> + mutex_unlock(&rdp_gp->nocb_gp_kthread_mutex);
>
> /* Spawn the kthread for this CPU. */

Some whitespace damage there.
[unhandled content-type:application/pkcs7-signature]
\
 
 \ /
  Last update: 2021-12-13 09:19    [W:0.061 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site