Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754243AbYACVG1 (ORCPT ); Thu, 3 Jan 2008 16:06:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752569AbYACVGS (ORCPT ); Thu, 3 Jan 2008 16:06:18 -0500 Received: from mga05.intel.com ([192.55.52.89]:41693 "EHLO fmsmga101.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752559AbYACVGR (ORCPT ); Thu, 3 Jan 2008 16:06:17 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.24,240,1196668800"; d="scan'208";a="480340598" Message-ID: <477D4D91.4010301@linux.intel.com> Date: Thu, 03 Jan 2008 22:03:13 +0100 From: Arjan van de Ven User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Olof Johansson CC: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton Subject: Re: [patch 1/3] move WARN_ON() out of line References: <477C32DA.5060905@linux.intel.com> <20080103045838.GA25642@lixom.net> In-Reply-To: <20080103045838.GA25642@lixom.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1861 Lines: 42 Olof Johansson wrote: > On Thu, Jan 03, 2008 at 01:56:58AM +0100, Arjan van de Ven wrote: >> Subject: move WARN_ON() out of line >> From: Arjan van de Ven >> CC: Ingo Molnar >> CC: Andrew Morton >> >> A quick grep shows that there are currently 1145 instances of WARN_ON >> in the kernel. Currently, WARN_ON is pretty much entirely inlined, >> which makes it hard to enhance it without growing the size of the kernel >> (and getting Andrew unhappy). >> >> This patch moves WARN_ON() out of line entirely. I've considered keeping >> the test inline and moving only the slowpath out of line, but I decided >> against that: an out of line test reduces the pressure on the CPUs >> branch predictor logic and gives smaller code, while a function call >> to a fixed location is quite fast. Likewise I've considered doing something >> similar to BUG() (eg use a trapping instruction) but that's not really >> better (it needs the test inline again and recovering from an invalid >> instruction isn't quite fun). > > Hi Arjan, > > I've got a couple of patches in -mm at the moment that introduces __WARN() > and uses that (and lets architectures override __WARN, since for example > powerpc does use trapping instructions similarly to BUG()). > > The two patches in question are: > > bugh-remove-have_arch_bug--have_arch_warn.patch > powerpc-switch-to-generic-warn_on-bug_on.patch > > Care to do this incrementally on top of that instead? I.e. call > do_warn_on() from the asm-generic/bug.h __WARN() instead. > > ok just did that; will post shortly -- 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/