Skip to content

Commit

Permalink
hugetlb: remove dummy definitions of HPAGE_MASK and HPAGE_SIZE
Browse files Browse the repository at this point in the history
Dummy, non-zero definitions for HPAGE_MASK and HPAGE_SIZE were added in
51c6f66 ("mm: ZAP_BLOCK causes redundant work") to avoid a divide
by zero in generic kernel code.

That code has since been removed, but probably should never have been
added in the first place: we don't want HPAGE_SIZE to act like PAGE_SIZE
for code that is working with hugepages, for example, when the
dependency on CONFIG_HUGETLB_PAGE has not been fulfilled.

Because hugepage size can differ from architecture to architecture, each
is required to have their own definitions for both HPAGE_MASK and
HPAGE_SIZE.  This is always done in arch/*/include/asm/page.h.

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.

Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rientjes authored and torvalds committed Nov 19, 2011
1 parent 208f6f6 commit a5c86e9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions include/linux/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ static inline void copy_huge_page(struct page *dst, struct page *src)

#define hugetlb_change_protection(vma, address, end, newprot)

#ifndef HPAGE_MASK
#define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */
#define HPAGE_SIZE PAGE_SIZE
#endif

#endif /* !CONFIG_HUGETLB_PAGE */

#define HUGETLB_ANON_FILE "anon_hugepage"
Expand Down

0 comments on commit a5c86e9

Please sign in to comment.