Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934202Ab0BYVoJ (ORCPT ); Thu, 25 Feb 2010 16:44:09 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:47987 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934187Ab0BYVn7 (ORCPT ); Thu, 25 Feb 2010 16:43:59 -0500 Subject: Re: [PATCH 2/3] sched: enforce per-cpu utilization limits on runtime balancing From: Peter Zijlstra To: Fabio Checconi Cc: Ingo Molnar , Thomas Gleixner , Paul Turner , Dario Faggioli , Michael Trimarchi , Dhaval Giani , Tommaso Cucinotta , linux-kernel@vger.kernel.org, Fabio Checconi In-Reply-To: <91b76b9b7555024d9afd7264eeae1b2db6a5e74c.1266931410.git.fabio@helm.retis> References: <91b76b9b7555024d9afd7264eeae1b2db6a5e74c.1266931410.git.fabio@helm.retis> Content-Type: text/plain; charset="UTF-8" Date: Thu, 25 Feb 2010 21:28:24 +0100 Message-ID: <1267129704.22519.560.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 32 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/