From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Carstens Subject: [patch 0/3] Allow inlined spinlocks again V3 Date: Wed, 12 Aug 2009 20:39:34 +0200 Message-ID: <20090812183934.777715527@de.ibm.com> Return-path: Received: from mtagate4.de.ibm.com ([195.212.29.153]:40619 "EHLO mtagate4.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956AbZHLSkf (ORCPT ); Wed, 12 Aug 2009 14:40:35 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.14.3/8.13.8) with ESMTP id n7CIePlB094698 for ; Wed, 12 Aug 2009 18:40:25 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n7CIePMT422022 for ; Wed, 12 Aug 2009 20:40:25 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n7CIeOgZ027834 for ; Wed, 12 Aug 2009 20:40:25 +0200 Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton Cc: Linus Torvalds , Peter Zijlstra , Ingo Molnar , linux-arch@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Arnd Bergmann , Horst Hartmann , Christian Ehrhardt Hi Andrew, since there were no objections to this patch set, would you mind picking it up for -mm? The patches are against current Linus' git head but also apply on top of the latest mmotm patch set. === This patch set allows to have inlined spinlocks again. The rationale behind this is that function calls on at least s390 are expensive. If one considers that server kernels are usually compiled with !CONFIG_PREEMPT a simple spin_lock is just a compare and swap loop. The extra overhead for a function call is significant. With inlined spinlocks overall cpu usage gets reduced by 1%-5% on s390. These numbers were taken with some network benchmarks. However I expect any workload that calls frequently into the kernel and which grabs a few locks to perform better. The implementation is straight forward: move the function bodies of the locking functions to static inline functions and place them in a header file. Dependent on CONFIG_SPINLOCK_INLINE generate out-of-line or inlined locking functions. The patches should be self explaining. V2: rewritten from scratch - now also with readable code V3: removed macro to generate out-of-line spinlock variants since that would break ctags. As requested by Arnd Bergmann.