Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164475
b: refs/heads/master
c: 3ae77f4
h: refs/heads/master
i:
  164473: f7297ce
  164471: f1ae49a
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Sep 22, 2009
1 parent 6a875d7 commit 8400266
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e919717c82c5773ac671816c8392c70d261685f
refs/heads/master: 3ae77f43b1118a76ea37952d444319c15e002c03
16 changes: 11 additions & 5 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,8 +2016,11 @@ static struct page *hugetlbfs_pagecache_page(struct hstate *h,
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 address_space *mapping;
Expand Down Expand Up @@ -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
* 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 &&
((flags & FOLL_DUMP) && !hugetlbfs_backed(h, vma, vaddr))) {
if (absent && (flags & FOLL_DUMP) &&
!hugetlbfs_pagecache_present(h, vma, vaddr)) {
remainder = 0;
break;
}
Expand Down

0 comments on commit 8400266

Please sign in to comment.