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>
This commit is contained in:
Родитель
6e919717c8
Коммит
3ae77f43b1
16
mm/hugetlb.c
16
mm/hugetlb.c
|
@ -2016,8 +2016,11 @@ static struct page *hugetlbfs_pagecache_page(struct hstate *h,
|
||||||
return find_lock_page(mapping, idx);
|
return find_lock_page(mapping, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return whether there is a pagecache page to back given address within VMA */
|
/*
|
||||||
static bool hugetlbfs_backed(struct hstate *h,
|
* Return whether there is a pagecache page to back given address within VMA.
|
||||||
|
* Caller follow_hugetlb_page() holds page_table_lock so we cannot lock_page.
|
||||||
|
*/
|
||||||
|
static bool hugetlbfs_pagecache_present(struct hstate *h,
|
||||||
struct vm_area_struct *vma, unsigned long address)
|
struct vm_area_struct *vma, unsigned long address)
|
||||||
{
|
{
|
||||||
struct address_space *mapping;
|
struct address_space *mapping;
|
||||||
|
@ -2254,10 +2257,13 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When coredumping, it suits get_dump_page if we just return
|
* When coredumping, it suits get_dump_page if we just return
|
||||||
* an error if there's a hole and no huge pagecache to back it.
|
* an error where there's an empty slot with no huge pagecache
|
||||||
|
* to back it. This way, we avoid allocating a hugepage, and
|
||||||
|
* the sparse dumpfile avoids allocating disk blocks, but its
|
||||||
|
* huge holes still show up with zeroes where they need to be.
|
||||||
*/
|
*/
|
||||||
if (absent &&
|
if (absent && (flags & FOLL_DUMP) &&
|
||||||
((flags & FOLL_DUMP) && !hugetlbfs_backed(h, vma, vaddr))) {
|
!hugetlbfs_pagecache_present(h, vma, vaddr)) {
|
||||||
remainder = 0;
|
remainder = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче