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: <20200520120450.GL317569@hirez.programming.kicks-ass.net>
Date:   Wed, 20 May 2020 14:04:50 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Will Deacon <will@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 1/8] locking: Introduce local_lock()

On Tue, May 19, 2020 at 10:19:05PM +0200, Sebastian Andrzej Siewior wrote:
> +/**
> + * DEFINE_LOCAL_LOCK - Define and initialize a per CPU local lock
> + * @lock:	Name of the lock instance
> + */
> +#define DEFINE_LOCAL_LOCK(lvar)					\
> +	DEFINE_PER_CPU(struct local_lock, lvar) = { INIT_LOCAL_LOCK(lvar) }
> +
> +/**
> + * DECLARE_LOCAL_LOCK - Declare a defined per CPU local lock
> + * @lock:	Name of the lock instance
> + */
> +#define DECLARE_LOCAL_LOCK(lvar)				\
> +	DECLARE_PER_CPU(struct local_lock, lvar)

So I think I'm going to argue having these is a mistake. The local_lock
should be put in a percpu structure along with the data it actually
protects.


> +#ifdef CONFIG_DEBUG_LOCK_ALLOC
> +# define LL_DEP_MAP_INIT(lockname)	.dep_map = { .name = #lockname }

That wants to be:

	.dep_map = {
		.name = #lockname,
		.wait_type_inner = LD_WAIT_SPIN,
	}

> +#else
> +# define LL_DEP_MAP_INIT(lockname)
> +#endif

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ