diff options
author | Hugh Dickins <hugh.dickins@tiscali.co.uk> | 2009-09-21 20:03:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:41 -0400 |
commit | 3ae77f43b1118a76ea37952d444319c15e002c03 (patch) | |
tree | 78152c28d4c8be8da36148e2e38e87e1b08b839b | |
parent | 6e919717c82c5773ac671816c8392c70d261685f (diff) |
mm: hugetlbfs_pagecache_present
Rename hugetlbfs_backed() to hugetlbfs_pagecache_present()
and add more comments, as suggested by Mel Gorman.
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: 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>
-rw-r--r-- | mm/hugetlb.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6b41f70bbc7f..815dbd4a6dcb 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2016,8 +2016,11 @@ static struct page *hugetlbfs_pagecache_page(struct hstate *h, | |||
2016 | return find_lock_page(mapping, idx); | 2016 | return find_lock_page(mapping, idx); |
2017 | } | 2017 | } |
2018 | 2018 | ||
2019 | /* Return whether there is a pagecache page to back given address within VMA */ | 2019 | /* |
2020 | static bool hugetlbfs_backed(struct hstate *h, | 2020 | * Return whether there is a pagecache page to back given address within VMA. |
2021 | * Caller follow_hugetlb_page() holds page_table_lock so we cannot lock_page. | ||
2022 | */ | ||
2023 | static bool hugetlbfs_pagecache_present(struct hstate *h, | ||
2021 | struct vm_area_struct *vma, unsigned long address) | 2024 | struct vm_area_struct *vma, unsigned long address) |
2022 | { | 2025 | { |
2023 | struct address_space *mapping; | 2026 | struct address_space *mapping; |
@@ -2254,10 +2257,13 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
2254 | 2257 | ||
2255 | /* | 2258 | /* |
2256 | * When coredumping, it suits get_dump_page if we just return | 2259 | * When coredumping, it suits get_dump_page if we just return |
2257 | * an error if there's a hole and no huge pagecache to back it. | 2260 | * an error where there's an empty slot with no huge pagecache |
2261 | * to back it. This way, we avoid allocating a hugepage, and | ||
2262 | * the sparse dumpfile avoids allocating disk blocks, but its | ||
2263 | * huge holes still show up with zeroes where they need to be. | ||
2258 | */ | 2264 | */ |
2259 | if (absent && | 2265 | if (absent && (flags & FOLL_DUMP) && |
2260 | ((flags & FOLL_DUMP) && !hugetlbfs_backed(h, vma, vaddr))) { | 2266 | !hugetlbfs_pagecache_present(h, vma, vaddr)) { |
2261 | remainder = 0; | 2267 | remainder = 0; |
2262 | break; | 2268 | break; |
2263 | } | 2269 | } |