Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755231AbbGTSoH (ORCPT ); Mon, 20 Jul 2015 14:44:07 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:35138 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbbGTSoF (ORCPT ); Mon, 20 Jul 2015 14:44:05 -0400 MIME-Version: 1.0 In-Reply-To: <55AC8CC4.1020802@monom.org> References: <20150622190553.GZ3644@twins.programming.kicks-ass.net> <5589285C.2010100@bmw-carit.de> <20150623143411.GA25159@twins.programming.kicks-ass.net> <558973A7.6010407@bmw-carit.de> <20150623175012.GD3644@twins.programming.kicks-ass.net> <20150623193624.GH18673@twins.programming.kicks-ass.net> <20150624084648.GB27873@gmail.com> <558A75EA.40905@bmw-carit.de> <55938163.7020606@monom.org> <20150702094155.GW19282@twins.programming.kicks-ass.net> <55AC8CC4.1020802@monom.org> Date: Mon, 20 Jul 2015 11:44:04 -0700 X-Google-Sender-Auth: 81A7bwVAXa6XAAbnmUZnWS48U0E Message-ID: Subject: Re: [RFC][PATCH 00/13] percpu rwsem -v2 From: Linus Torvalds To: Daniel Wagner Cc: Peter Zijlstra , Ingo Molnar , Oleg Nesterov , Paul McKenney , Tejun Heo , Ingo Molnar , Linux Kernel Mailing List , der.herr@hofr.at, Davidlohr Bueso , Rik van Riel , Al Viro , Jeff Layton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1422 Lines: 36 On Sun, Jul 19, 2015 at 10:53 PM, Daniel Wagner wrote: > > Turning them back into arch_spinlock_t gives almost the same numbers as > with spinlock_t. > > Then Peter suggested to change the code to > > preempt_disable(); > spin_unlock(); > preempt_enable_no_resched(); > > to verify if arch_spin_lock() is buggy and does not disable preemption > and we see a lock holder preemption on non virt setups. Hmm. "arch_spin_lock()" isn't _supposed_ to disable preemption. The caller should do that (possibly by disabling interrupts). See include/linux/spinlock_api_smp.h for details. But yes, that's a *very* subtle difference between "arch_spin_lock()" and "spin_lock()". The former doesn't do lockdep or other debugging and it doesn't disable preemption. So they are not interchangeable. The current lglocks uses arch_spin_lock exactly because it does not *want* lockdep tracking (it does its own) and because it does its own preemption handling. So saying "verify if arch_spin_lock() is buggy and does not disable preemption" is complete BS. If arch_spin_lock() were to disable preemption, _that_ would be a bug. Linus -- 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/