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, 25 Feb 2010 21:28:24 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Fabio Checconi <fchecconi@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Paul Turner <pjt@...gle.com>,
	Dario Faggioli <faggioli@...dalf.sssup.it>,
	Michael Trimarchi <michael@...dence.eu.com>,
	Dhaval Giani <dhaval@...is.sssup.it>,
	Tommaso Cucinotta <t.cucinotta@...up.it>,
	linux-kernel@...r.kernel.org,
	Fabio Checconi <fabio@...dalf.sssup.it>
Subject: Re: [PATCH 2/3] sched: enforce per-cpu utilization limits on
 runtime balancing

On Tue, 2010-02-23 at 19:56 +0100, Fabio Checconi wrote:
> +static inline void double_spin_lock(raw_spinlock_t *lock1,
> +                                   raw_spinlock_t *lock2)
> +       __acquires(lock1)
> +       __acquires(lock2)
> +{
> +       if (lock1 < lock2) {
> +               raw_spin_lock(lock1);
> +               raw_spin_lock_nested(lock2, SINGLE_DEPTH_NESTING);
> +       } else {
> +               raw_spin_lock(lock2);
> +               raw_spin_lock_nested(lock1, SINGLE_DEPTH_NESTING);
> +       }
> +}
> +
> +static inline void double_spin_unlock(raw_spinlock_t *lock1,
> +                                     raw_spinlock_t *lock2)
> +       __releases(lock1)
> +       __releases(lock2)
> +{
> +       raw_spin_unlock(lock1);
> +       lock_set_subclass(&lock2->dep_map, 0, _RET_IP_);
> +       raw_spin_unlock(lock2);
> +} 

If you release both there is no need to re-set the subclass.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists