From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch] hugetlb: remove dummy definitions of HPAGE_MASK and HPAGE_SIZE Date: Thu, 17 Nov 2011 15:57:03 -0800 Message-ID: <20111117155703.b8af6be5.akpm@linux-foundation.org> References: <1321567050-13197-1-git-send-email-ddaney.cavm@gmail.com> <20111117153526.f90ee248.akpm@linux-foundation.org> <4EC59E3C.5070204@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EC59E3C.5070204@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: David Daney Cc: David Rientjes , "linux-mips@linux-mips.org" , "ralf@linux-mips.org" , "linux-kernel@vger.kernel.org" , David Daney , "linux-arch@vger.kernel.org" , Robin Holt List-Id: linux-arch.vger.kernel.org On Thu, 17 Nov 2011 15:52:28 -0800 David Daney wrote: > A counter argument would be: > > There are hundreds of places in the kernel where dummy definitions are > selected by !CONFIG_* so that we can do: > > if (test_something()) { > do_one_thing(); > } else { > do_the_other_thing(); > } > > > Rather than: > > #ifdef CONFIG_SOMETHING > if (test_something()) { > do_one_thing(); > } else > #else > { > do_the_other_thing(); > } > > > > We even do this all over the place with dummy definitions selected by > CONFIG_HUGETLB_PAGE, What exactly makes HPAGE_MASK special and not the > hundreds of other similar situations? yup. Look at free_pgtables(): if (is_vm_hugetlb_page(vma)) { hugetlb_free_pgd_range(tlb, addr, vma->vm_end, floor, next? next->vm_start: ceiling); } else { and #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) This is the same thing. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:45634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935Ab1KQX5E (ORCPT ); Thu, 17 Nov 2011 18:57:04 -0500 Date: Thu, 17 Nov 2011 15:57:03 -0800 From: Andrew Morton Subject: Re: [patch] hugetlb: remove dummy definitions of HPAGE_MASK and HPAGE_SIZE Message-ID: <20111117155703.b8af6be5.akpm@linux-foundation.org> In-Reply-To: <4EC59E3C.5070204@gmail.com> References: <1321567050-13197-1-git-send-email-ddaney.cavm@gmail.com> <20111117153526.f90ee248.akpm@linux-foundation.org> <4EC59E3C.5070204@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: David Daney Cc: David Rientjes , "linux-mips@linux-mips.org" , "ralf@linux-mips.org" , "linux-kernel@vger.kernel.org" , David Daney , "linux-arch@vger.kernel.org" , Robin Holt Message-ID: <20111117235703.VD8N6hgRq5X7b13d3HjEJFcHZerSMuRMVPL9AmkuEAI@z> On Thu, 17 Nov 2011 15:52:28 -0800 David Daney wrote: > A counter argument would be: > > There are hundreds of places in the kernel where dummy definitions are > selected by !CONFIG_* so that we can do: > > if (test_something()) { > do_one_thing(); > } else { > do_the_other_thing(); > } > > > Rather than: > > #ifdef CONFIG_SOMETHING > if (test_something()) { > do_one_thing(); > } else > #else > { > do_the_other_thing(); > } > > > > We even do this all over the place with dummy definitions selected by > CONFIG_HUGETLB_PAGE, What exactly makes HPAGE_MASK special and not the > hundreds of other similar situations? yup. Look at free_pgtables(): if (is_vm_hugetlb_page(vma)) { hugetlb_free_pgd_range(tlb, addr, vma->vm_end, floor, next? next->vm_start: ceiling); } else { and #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) This is the same thing.