lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Jun 2018 00:25:44 +0900
From:   Byungchul Park <max.byungchul.park@...il.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Byungchul Park <byungchul.park@....com>, jiangshanlai@...il.com,
        Paul McKenney <paulmck@...ux.vnet.ibm.com>,
        josh@...htriplett.org,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        linux-kernel@...r.kernel.org, kernel-team@....com,
        Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [RFC 1/2] rcu: Do prepare and cleanup idle depending on in_nmi()

On Wed, Jun 20, 2018 at 10:33 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> On Wed, 20 Jun 2018 17:47:19 +0900
> Byungchul Park <byungchul.park@....com> wrote:
>
>> Get rid of dependency on ->dynticks_nmi_nesting.
>
> This is not a trivial change. Can you please explain the rational and
> background in the change log. Add enough context here to know why this
> change is needed.

I'm sorry I didn't. I thought I could add enough explanation after
requesting for comment and getting answer. But I should've done
that :(

The 1st patch is the 1st step for removing ->dynticks_nmi_nesting
entirely from the code, which is done mainly in the 2nd patch.

At the next spin(not RFC), I will add full explanation about what you
point out.

Thanks a lot.

> Thanks!
>
> -- Steve
>
>>
>> Signed-off-by: Byungchul Park <byungchul.park@....com>
>> ---
>>  kernel/rcu/tree.c | 22 ++++++++++------------
>>  1 file changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
>> index deb2508..59ae94e 100644
>> --- a/kernel/rcu/tree.c
>> +++ b/kernel/rcu/tree.c
>> @@ -797,6 +797,11 @@ void rcu_nmi_exit(void)
>>               return;
>>       }
>>
>> +     if (!in_nmi()) {
>> +             rcu_prepare_for_idle();
>> +             rcu_dynticks_task_enter();
>> +     }
>> +
>>       /* This NMI interrupted an RCU-idle CPU, restore RCU-idleness. */
>>       trace_rcu_dyntick(TPS("Startirq"), rdtp->dynticks_nmi_nesting, 0, rdtp->dynticks);
>>       WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0); /* Avoid store tearing. */
>> @@ -824,14 +829,8 @@ void rcu_nmi_exit(void)
>>   */
>>  void rcu_irq_exit(void)
>>  {
>> -     struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
>> -
>>       lockdep_assert_irqs_disabled();
>> -     if (rdtp->dynticks_nmi_nesting == 1)
>> -             rcu_prepare_for_idle();
>>       rcu_nmi_exit();
>> -     if (rdtp->dynticks_nmi_nesting == 0)
>> -             rcu_dynticks_task_enter();
>>  }
>>
>>  /*
>> @@ -944,6 +943,11 @@ void rcu_nmi_enter(void)
>>       if (rcu_dynticks_curr_cpu_in_eqs()) {
>>               rcu_dynticks_eqs_exit();
>>               incby = 1;
>> +
>> +             if (!in_nmi()) {
>> +                     rcu_dynticks_task_exit();
>> +                     rcu_cleanup_after_idle();
>> +             }
>>       }
>>       trace_rcu_dyntick(incby == 1 ? TPS("Endirq") : TPS("++="),
>>                         rdtp->dynticks_nmi_nesting,
>> @@ -977,14 +981,8 @@ void rcu_nmi_enter(void)
>>   */
>>  void rcu_irq_enter(void)
>>  {
>> -     struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
>> -
>>       lockdep_assert_irqs_disabled();
>> -     if (rdtp->dynticks_nmi_nesting == 0)
>> -             rcu_dynticks_task_exit();
>>       rcu_nmi_enter();
>> -     if (rdtp->dynticks_nmi_nesting == 1)
>> -             rcu_cleanup_after_idle();
>>  }
>>
>>  /*
>



-- 
Thanks,
Byungchul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ