[Top] [All Lists]

Re: [patch] hugetlb: remove dummy definitions of HPAGE_MASK and HPAGE_SI

To: Andrew Morton <>
Subject: Re: [patch] hugetlb: remove dummy definitions of HPAGE_MASK and HPAGE_SIZE
From: David Rientjes <>
Date: Thu, 17 Nov 2011 15:44:50 -0800 (PST)
Cc: David Daney <>,,,, David Daney <>,, Robin Holt <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=beta; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=nh0+qcNac41q+BikpY77ogfKInCpOlfG7r5MJMDMz+U=; b=QiKWibe0Sj9zxj2OgRhYiMe1A301rCrT0cvYXiajMr4Gr2raJlihznhoG6rGQiWxOq J9fd0ZQS1A42WoucwSGw==
In-reply-to: <>
References: <> <> <> <>
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Thu, 17 Nov 2011, Andrew Morton wrote:

> > So, just remove the dummy and dangerous definitions since they are no
> > longer needed and reveals the correct dependencies.  Tested on
> > architectures using the definitions with allyesconfig: x86 (even with
> > thp), hppa, mips, powerpc, s390, sh3, sh4, sparc, and sparc64, and
> > with defconfig on ia64.
> How could arch/mips/mm/tlb-r4k.c:local_flush_tlb_range() compile OK
> with this change?

This was tested on Linus' tree, not on Ralf's linux-next tree.  All uses 
of HPAGE_* are protected by CONFIG_HUGETLB_PAGE as it appropriately should 
be in Linus' tree in that file.

> What that function is doing looks reasonable to me.  Why fill the poor
> thing with an ifdef mess?
> otoh, catching mistakes is good too.  Doing it at runtime as David
> proposes is OK.

Nobody else needs it other than Ralf's pending change, and you're 
suggesting we need them in a generic header file when any sane arch that 
uses hugepages (all of them, in the current tree) declares these 
themselves in arch/*/include/asm/page.h where it's supposed to be done?

Why on earth do we have CONFIG_HUGETLB_PAGE for at all, then?  To catch 
code that's operating on hugepages when our kernel doesn't support it.  
I'd much rather break the build than get a runtime BUG() because we want 
to avoid an #ifdef or actually write well-written code like every other 
arch has!  Panicking the code to find errors like this is just insanity.

<Prev in Thread] Current Thread [Next in Thread>