lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 rcu 04/18] rcu: Weaken ->dynticks accesses and updates
----- On Jul 28, 2021, at 1:37 PM, paulmck paulmck@kernel.org wrote:
[...]
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 42a0032dd99f7..c87b3a271d65b 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -251,6 +251,15 @@ void rcu_softirq_qs(void)
> rcu_tasks_qs(current, false);
> }
>
> +/*
> + * Increment the current CPU's rcu_data structure's ->dynticks field
> + * with ordering. Return the new value.
> + */
> +static noinstr unsigned long rcu_dynticks_inc(int incby)
> +{
> + return arch_atomic_add_return(incby, this_cpu_ptr(&rcu_data.dynticks));
> +}
> +

[...]

> @@ -308,7 +317,7 @@ static void rcu_dynticks_eqs_online(void)
>
> if (atomic_read(&rdp->dynticks) & 0x1)
> return;

Can the thread be migrated at this point ? If yes, then
the check and the increment may happen on different cpu's rdps. Is
that OK ?

> - atomic_inc(&rdp->dynticks);
> + rcu_dynticks_inc(1);
> }

Thanks,

Mathieu

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
\
 
 \ /
  Last update: 2021-07-28 20:24    [W:0.143 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site