Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdCOCPc (ORCPT ); Tue, 14 Mar 2017 22:15:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:38157 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751071AbdCOCOh (ORCPT ); Tue, 14 Mar 2017 22:14:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,166,1486454400"; d="scan'208";a="1108544251" From: Andi Kleen To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 7/7] Remove expensive WARN_ON in pagefault_disabled_dec Date: Tue, 14 Mar 2017 19:14:31 -0700 Message-Id: <20170315021431.13107-8-andi@firstfloor.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170315021431.13107-1-andi@firstfloor.org> References: <20170315021431.13107-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1044 Lines: 33 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); } /* -- 2.9.3