From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753293AbdBJQE3 (ORCPT ); Fri, 10 Feb 2017 11:04:29 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:33229 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbdBJQEN (ORCPT ); Fri, 10 Feb 2017 11:04:13 -0500 Date: Fri, 10 Feb 2017 12:53:52 +0100 (CET) From: Thomas Gleixner To: Waiman Long cc: Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86, locking: Inline *_unlock_bh & *_unlock_irqrestore In-Reply-To: <1486060589-31572-1-git-send-email-longman@redhat.com> Message-ID: References: <1486060589-31572-1-git-send-email-longman@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Feb 2017, Waiman Long wrote: > For spinlock and read-write locks, both *_unlock() and *_unlock_irq() > functions are inlined if !PREEMPT. Whereas the *_unlock_bh() and > *unlock_irqrestore() are not inlined as that will increase the size > of the kernel binary. > > Given the fact that the PV qspinlock unlock call is a callee-saved > function pointer, the unlock function is essentially a leaf function > if !PREEMPT is true under all circumstances. Inlining it will enable > the compiler to do much better optimization around the the unlock > call sites. Similarly for the read-write locks. > > To unleash this additional performance, all these unlock functions > are now inlined for x86-64 kernel where kernel size is usually less > of a concern. For 32-bit kernel, it is assumed that the focus will > be a bit more on kernel size optimization and so those functions are > not inlined. > > With 4.9.6 kernel source and gcc 4.8.5-11 compiler, the text size > of the base vmlinux binary increased from 8527918 bytes to 8462235 > bytes. That was an increase of 0.78%. Increased from 8527918 bytes to 8462235?