From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760772AbZBESop (ORCPT ); Thu, 5 Feb 2009 13:44:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755627AbZBESof (ORCPT ); Thu, 5 Feb 2009 13:44:35 -0500 Received: from mx2.mail.elte.hu ([157.181.151.9]:59185 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754873AbZBESof (ORCPT ); Thu, 5 Feb 2009 13:44:35 -0500 Date: Thu, 5 Feb 2009 19:43:55 +0100 From: Ingo Molnar To: Jeremy Fitzhardinge Cc: William Lee Irwin III , Linux Kernel Mailing List , Linux Memory Management List Subject: Re: pud_bad vs pud_bad Message-ID: <20090205184355.GF5661@elte.hu> References: <498B2EBC.60700@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <498B2EBC.60700@goop.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jeremy Fitzhardinge wrote: > I'm looking at unifying the 32 and 64-bit versions of pud_bad. > > 32-bits defines it as: > > static inline int pud_bad(pud_t pud) > { > return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; > } > > and 64 as: > > static inline int pud_bad(pud_t pud) > { > return (pud_val(pud) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; > } > > > I'm inclined to go with the 64-bit version, but I'm wondering if there's > something subtle I'm missing here. Why go with the 64-bit version? The 32-bit check looks more compact and should result in smaller code. Ingo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id 6022F6B003D for ; Thu, 5 Feb 2009 13:44:35 -0500 (EST) Date: Thu, 5 Feb 2009 19:43:55 +0100 From: Ingo Molnar Subject: Re: pud_bad vs pud_bad Message-ID: <20090205184355.GF5661@elte.hu> References: <498B2EBC.60700@goop.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <498B2EBC.60700@goop.org> Sender: owner-linux-mm@kvack.org To: Jeremy Fitzhardinge Cc: William Lee Irwin III , Linux Kernel Mailing List , Linux Memory Management List List-ID: * Jeremy Fitzhardinge wrote: > I'm looking at unifying the 32 and 64-bit versions of pud_bad. > > 32-bits defines it as: > > static inline int pud_bad(pud_t pud) > { > return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0; > } > > and 64 as: > > static inline int pud_bad(pud_t pud) > { > return (pud_val(pud) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE; > } > > > I'm inclined to go with the 64-bit version, but I'm wondering if there's > something subtle I'm missing here. Why go with the 64-bit version? The 32-bit check looks more compact and should result in smaller code. Ingo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org