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]
Message-ID: <87v96y2fyz.fsf@jogness.linutronix.de>
Date:   Tue, 01 Jun 2021 09:37:08 +0200
From:   John Ogness <john.ogness@...utronix.de>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>
Cc:     Petr Mladek <pmladek@...e.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Stephen Boyd <swboyd@...omium.org>,
        Alexander Potapenko <glider@...gle.com>,
        "Paul E. McKenney" <paulmck@...nel.org>
Subject: Re: [PATCH next v1 1/2] dump_stack: move cpu lock to printk.c

On 2021-06-01, John Ogness <john.ogness@...utronix.de> wrote:
>> Is there any particular reason this does
>>
>> 	preempt_disable();
>> 	cpu = smp_processor_id();
>> 	local_irq_safe();
>>
>> instead of
>>
>> 	local_irq_safe();
>> 	cpu = raw_smp_processor_id();
>>
>> ?
>
> If the lock is owned by another CPU, there is no need to disable
> interrupts for this CPU. (The local_irq_save() is conditional.)

The cpu lock implementation from dump_stack() also keeps preemption
continually enabled while spinning. I used the cpu lock implementation
from PREEMPT_RT. But for my v2 I will adopt the same ordering from
dump_stack(), as you are suggesting.

Thanks for pointing that out.

John Ogness

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ