From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754124AbdCOVtH (ORCPT ); Wed, 15 Mar 2017 17:49:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54552 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbdCOVtG (ORCPT ); Wed, 15 Mar 2017 17:49:06 -0400 Date: Wed, 15 Mar 2017 14:49:04 -0700 From: Andrew Morton To: Andi Kleen Cc: linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec Message-Id: <20170315144904.dcb87c7eb45aa52490d656ee@linux-foundation.org> In-Reply-To: <20170315021431.13107-8-andi@firstfloor.org> References: <20170315021431.13107-1-andi@firstfloor.org> <20170315021431.13107-8-andi@firstfloor.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Mar 2017 19:14:31 -0700 Andi Kleen wrote: > From: Andi Kleen > > pagefault_disabled_dec is frequently used inline, and it has a WARN_ON > for underflow that expands to about 6.5k of extra code. The warning > doesn't seem to be that useful and worth so much code so remove it. > > If it was needed could make it depending on some debug kernel option. > > Saves ~6.5k in my kernel > > text data bss dec hex filename > 9039417 5367568 11116544 25523529 1857549 vmlinux-before-pf > 9032805 5367568 11116544 25516917 1855b75 vmlinux-pf > > Signed-off-by: Andi Kleen > --- > include/linux/uaccess.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h > index f30c187ed785..b691aad918fb 100644 > --- a/include/linux/uaccess.h > +++ b/include/linux/uaccess.h > @@ -12,7 +12,6 @@ static __always_inline void pagefault_disabled_inc(void) > static __always_inline void pagefault_disabled_dec(void) > { > current->pagefault_disabled--; > - WARN_ON(current->pagefault_disabled < 0); > } Fair enough. We could switch to VM_WARN_ON but apparently even that is now being enabled in some production systems, which somewhat defeats its intent...