diff options
author | Hugh Dickins <hugh.dickins@tiscali.co.uk> | 2009-09-21 20:03:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:40 -0400 |
commit | 2a15efc953b26ad57d7d38b9e6782d57e53b4ab2 (patch) | |
tree | f4d04903b3303e80460d2fa3f38da2b7eea82d22 /mm/memory.c | |
parent | 8e4b9a60718970bbc02dfd3abd0b956ab65af231 (diff) |
mm: follow_hugetlb_page flags
follow_hugetlb_page() shouldn't be guessing about the coredump case
either: pass the foll_flags down to it, instead of just the write bit.
Remove that obscure huge_zeropage_ok() test. The decision is easy,
though unlike the non-huge case - here vm_ops->fault is always set.
But we know that a fault would serve up zeroes, unless there's
already a hugetlbfs pagecache page to back the range.
(Alternatively, since hugetlb pages aren't swapped out under pressure,
you could save more dump space by arguing that a page not yet faulted
into this process cannot be relevant to the dump; but that would be
more surprising.)
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/memory.c b/mm/memory.c index 532a55bce6a4..6359a4f80c4a 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1260,17 +1260,19 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1260 | !(vm_flags & vma->vm_flags)) | 1260 | !(vm_flags & vma->vm_flags)) |
1261 | return i ? : -EFAULT; | 1261 | return i ? : -EFAULT; |
1262 | 1262 | ||
1263 | if (is_vm_hugetlb_page(vma)) { | ||
1264 | i = follow_hugetlb_page(mm, vma, pages, vmas, | ||
1265 | &start, &nr_pages, i, write); | ||
1266 | continue; | ||
1267 | } | ||
1268 | |||
1269 | foll_flags = FOLL_TOUCH; | 1263 | foll_flags = FOLL_TOUCH; |
1270 | if (pages) | 1264 | if (pages) |
1271 | foll_flags |= FOLL_GET; | 1265 | foll_flags |= FOLL_GET; |
1272 | if (flags & GUP_FLAGS_DUMP) | 1266 | if (flags & GUP_FLAGS_DUMP) |
1273 | foll_flags |= FOLL_DUMP; | 1267 | foll_flags |= FOLL_DUMP; |
1268 | if (write) | ||
1269 | foll_flags |= FOLL_WRITE; | ||
1270 | |||
1271 | if (is_vm_hugetlb_page(vma)) { | ||
1272 | i = follow_hugetlb_page(mm, vma, pages, vmas, | ||
1273 | &start, &nr_pages, i, foll_flags); | ||
1274 | continue; | ||
1275 | } | ||
1274 | 1276 | ||
1275 | do { | 1277 | do { |
1276 | struct page *page; | 1278 | struct page *page; |