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:   Tue, 2 Oct 2018 11:06:02 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Will Deacon <will.deacon@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] locking/lockdep: Eliminate redundant irqs check in
 __lock_acquire()


* Waiman Long <longman@...hat.com> wrote:

> The static __lock_acquire() function has only two callers:
> 
>  1) lock_acquire()
>  2) reacquire_held_locks()
> 
> In lock_acquire(), raw_local_irq_save() is called before hand. So
> irqs must have been disabled. So the check

s/before hand/
 /beforehand

s/irqs
 /IRQs

> 
> 	DEBUG_LOCKS_WARN_ON(!irqs_disabled())
> 
> is kind of redundant in thise case. So move the above check
> to reacquire_held_locks() to eliminate redundant code in the
> lock_acquire path.

s/thise
 /this

s/lock_acquire path
 /lock_acquire() path
 
> Signed-off-by: Waiman Long <longman@...hat.com>
> ---
>  kernel/locking/lockdep.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 8f9de7c..add0468 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -3192,6 +3192,10 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name,
>  /*
>   * This gets called for every mutex_lock*()/spin_lock*() operation.
>   * We maintain the dependency maps and validate the locking attempt:
> + *
> + * The callers must make sure that IRQs are disabled before calling it.
> + * otherwise we could get an interrupt which would want to take locks,
> + * which would end up in lockdep again.

Spelling nit: a comma after the first line, like it was in the original version:

> -	/*
> -	 * Lockdep should run with IRQs disabled, otherwise we could
> -	 * get an interrupt which would want to take locks, which would
> -	 * end up in lockdep and have you got a head-ache already?
> -	 */

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ