diff options
author | Steven Truelove <steven.truelove@utoronto.ca> | 2012-03-21 19:34:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 20:54:59 -0400 |
commit | 40716e29243de46720e5773797791466c28904ec (patch) | |
tree | 19616ad05cbead73d0643b002a7ced8baa292ee2 /mm | |
parent | 21a3c273f88c9cbbaf7e14505df0131d95c8f262 (diff) |
hugetlbfs: fix alignment of huge page requests
When calling shmget() with SHM_HUGETLB, shmget aligns the request size to
PAGE_SIZE, but this is not sufficient.
Modify hugetlb_file_setup() to align requests to the huge page size, and
to accept an address argument so that all alignment checks can be
performed in hugetlb_file_setup(), rather than in its callers. Change
newseg() and mmap_pgoff() to match the new prototype and eliminate a now
redundant alignment check.
[akpm@linux-foundation.org: fix build]
Signed-off-by: Steven Truelove <steven.truelove@utoronto.ca>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1099,9 +1099,9 @@ SYSCALL_DEFINE6(mmap_pgoff, unsigned long, addr, unsigned long, len, | |||
1099 | * A dummy user value is used because we are not locking | 1099 | * A dummy user value is used because we are not locking |
1100 | * memory so no accounting is necessary | 1100 | * memory so no accounting is necessary |
1101 | */ | 1101 | */ |
1102 | len = ALIGN(len, huge_page_size(&default_hstate)); | 1102 | file = hugetlb_file_setup(HUGETLB_ANON_FILE, addr, len, |
1103 | file = hugetlb_file_setup(HUGETLB_ANON_FILE, len, VM_NORESERVE, | 1103 | VM_NORESERVE, &user, |
1104 | &user, HUGETLB_ANONHUGE_INODE); | 1104 | HUGETLB_ANONHUGE_INODE); |
1105 | if (IS_ERR(file)) | 1105 | if (IS_ERR(file)) |
1106 | return PTR_ERR(file); | 1106 | return PTR_ERR(file); |
1107 | } | 1107 | } |