hugetlb: modular state for hugetlb page size
commita5516438959d90b071ff0a484ce4f3f523dc3152
authorAndi Kleen <ak@suse.de>
Thu, 24 Jul 2008 04:27:41 +0000 (23 21:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:17 +0000 (24 10:47 -0700)
treee356ba9364c76b93c176b4d4a262b7aca3ee8f91
parentb7ba30c679ed1eb7ed3ed8f281f6493282042bd4
hugetlb: modular state for hugetlb page size

The goal of this patchset is to support multiple hugetlb page sizes.  This
is achieved by introducing a new struct hstate structure, which
encapsulates the important hugetlb state and constants (eg.  huge page
size, number of huge pages currently allocated, etc).

The hstate structure is then passed around the code which requires these
fields, they will do the right thing regardless of the exact hstate they
are operating on.

This patch adds the hstate structure, with a single global instance of it
(default_hstate), and does the basic work of converting hugetlb to use the
hstate.

Future patches will add more hstate structures to allow for different
hugetlbfs mounts to have different page sizes.

[akpm@linux-foundation.org: coding-style fixes]
Acked-by: Adam Litke <agl@us.ibm.com>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19 files changed:
arch/ia64/mm/hugetlbpage.c
arch/powerpc/mm/hugetlbpage.c
arch/s390/mm/hugetlbpage.c
arch/sh/mm/hugetlbpage.c
arch/sparc64/mm/hugetlbpage.c
arch/x86/mm/hugetlbpage.c
fs/hugetlbfs/inode.c
include/asm-ia64/hugetlb.h
include/asm-powerpc/hugetlb.h
include/asm-s390/hugetlb.h
include/asm-sh/hugetlb.h
include/asm-sparc/hugetlb.h
include/asm-x86/hugetlb.h
include/linux/hugetlb.h
ipc/shm.c
mm/hugetlb.c
mm/memory.c
mm/mempolicy.c
mm/mmap.c