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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Nov 2011 15:52:28 -0800
David Daney <ddaney.cavm@xxxxxxxxx> 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.



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux