Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 7 Feb 2001 15:43:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 7 Feb 2001 15:43:25 -0500 Received: from [62.172.234.2] ([62.172.234.2]:18331 "EHLO localhost.localdomain") by vger.kernel.org with ESMTP id ; Wed, 7 Feb 2001 15:43:15 -0500 Date: Wed, 7 Feb 2001 20:42:51 +0000 (GMT) From: Hugh Dickins To: Linus Torvalds cc: Rik van Riel , Mark Hahn , David Howells , linux-kernel@vger.kernel.org Subject: Re: [PATCH] micro-opt DEBUG_ADD_PAGE In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Feb 2001, Linus Torvalds wrote: > > I'd rather not do these kinds of things that the compiler should be able > to trivially do for us. > > (gcc sometimes _does_ do these things. I've seen it. Why doesn't it do it > here? Did you check the code? Have you asked the gcc lists?) The "(1< 239: 8b 43 18 mov 0x18(%ebx),%eax 23c: a8 80 test $0x80,%al 23e: 75 08 jne 248 240: 8b 43 18 mov 0x18(%ebx),%eax 243: f6 c4 08 test $0x8,%ah 246: 74 19 je 261 2.97 is jumpier: mov and je mov test jne mov test jne jmp. That looks worse to me: David, earlier on you advertized http://www.codesourcery.com/gcc-snapshots/ Is this something worth your pursuing with the gcc guys? Hugh --- linux-2.4.2-pre1/include/linux/swap.h Wed Feb 7 15:21:13 2001 +++ linux/include/linux/swap.h Wed Feb 7 17:21:25 2001 @@ -200,8 +200,8 @@ * with the pagemap_lru_lock held! */ #define DEBUG_ADD_PAGE \ - if (PageActive(page) || PageInactiveDirty(page) || \ - PageInactiveClean(page)) BUG(); + if ((page)->flags & ((1<