mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
hugetlb: add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
Add a flag for mmap that will be used to request a huge page region that will look like anonymous memory to userspace. This is accomplished by using a file on the internal vfsmount. MAP_HUGETLB is a modifier of MAP_ANONYMOUS and so must be specified with it. The region will behave the same as a MAP_ANONYMOUS region using small pages. [akpm@linux-foundation.org: fix arch definitions of MAP_HUGETLB] Signed-off-by: Eric B Munson <ebmunson@us.ibm.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Adam Litke <agl@us.ibm.com> Cc: David Gibson <david@gibson.dropbear.id.au> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
90f72aa58b
commit
4e52780d41
2 changed files with 25 additions and 0 deletions
|
@ -112,12 +112,19 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
|||
|
||||
#endif /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
#define HUGETLB_ANON_FILE "anon_hugepage"
|
||||
|
||||
enum {
|
||||
/*
|
||||
* The file will be used as an shm file so shmfs accounting rules
|
||||
* apply
|
||||
*/
|
||||
HUGETLB_SHMFS_INODE = 1,
|
||||
/*
|
||||
* The file is being created on the internal vfs mount and shmfs
|
||||
* accounting rules do not apply
|
||||
*/
|
||||
HUGETLB_ANONHUGE_INODE = 2,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_HUGETLBFS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue