From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265038AbUGLK1A (ORCPT ); Mon, 12 Jul 2004 06:27:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266781AbUGLK1A (ORCPT ); Mon, 12 Jul 2004 06:27:00 -0400 Received: from cantor.suse.de ([195.135.220.2]:29883 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S265038AbUGLK07 (ORCPT ); Mon, 12 Jul 2004 06:26:59 -0400 Date: Mon, 12 Jul 2004 12:17:05 +0200 Message-ID: From: Takashi Iwai To: Andrea Arcangeli Cc: Christoph Hellwig , Ingo Molnar , linux-kernel@vger.kernel.org, Arjan van de Ven Subject: Re: [announce] [patch] Voluntary Kernel Preemption Patch In-Reply-To: <20040710005208.GW20947@dualathlon.random> References: <20040709182638.GA11310@elte.hu> <20040709195105.GA4807@infradead.org> <20040709235017.GP20947@dualathlon.random> <20040710005208.GW20947@dualathlon.random> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Sat, 10 Jul 2004 02:52:08 +0200, Andrea Arcangeli wrote: > > On Sat, Jul 10, 2004 at 01:50:17AM +0200, Andrea Arcangeli wrote: > > agreed. might_sleep() just like BUG() can be defined to noop. > > BTW, this reminded me a related topic that I can't recall being ever > mentioned on l-k: BUG_ON can also be optimized away. So people should be > careful not to do write this: > > BUG_ON(test_and_set_bit(p)) > > but to write this instead: > > if (unlikely(test_and_set_bit(p)) > BUG() Couldn't it be simply written like below? #define BUILD_BUG_ON(condition) do { if (unlikely(condition)) BUILD_BUG(); } while(0) Takashi