Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323Ab3FXMyq (ORCPT ); Mon, 24 Jun 2013 08:54:46 -0400 Received: from www.linutronix.de ([62.245.132.108]:48916 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750745Ab3FXMyo (ORCPT ); Mon, 24 Jun 2013 08:54:44 -0400 Date: Mon, 24 Jun 2013 14:54:43 +0200 (CEST) From: Thomas Gleixner To: Kirill Tkhai cc: "linux-kernel@vger.kernel.org" , Steven Rostedt , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH 1/2] sched: Add schedule_(raw_)spin_unlock and schedule_(raw_)spin_unlock_irq In-Reply-To: <1981131371569812@web20h.yandex.ru> Message-ID: References: <1981131371569812@web20h.yandex.ru> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 40 On Tue, 18 Jun 2013, Kirill Tkhai wrote: > +/* > + * schedule_raw_spin_unlock() -- should be used instead of pattern: > + * > + * raw_spin_unlock(lock); > + * schedule(); > + * > + * It's the same, but prevents preempt_schedule() call during the unlocking. > + */ > +static inline void schedule_raw_spin_unlock(raw_spinlock_t *lock) This should be raw_spin_unlock_and_schedule(). schedule_raw_spin_unlock() sounds like we schedule a raw_spin_unlock() for some point in the future. > +{ > + _raw_spin_unlock_no_resched(lock); No, please do not expose such an interface. Instead of that implement it as: raw_spin_unlock_and_schedule() { spin_release(&lock->dep_map, 1, _RET_IP_); do_raw_spin_unlock(lock); preempt_enable_no_resched(); schedule(); } And this goes into the spinlock header and not into sched.h. Thanks, tglx -- 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/