projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
887b22c
)
mm/memory: remove page fault assumption of compound page size
author
Matthew Wilcox (Oracle)
<willy@infradead.org>
Fri, 16 Oct 2020 03:05:26 +0000
(20:05 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:15 +0000
(11:11 -0700)
A compound page in the page cache will not necessarily be of PMD size,
so check explicitly.
[willy@infradead.org: fix remove page fault assumption of compound page size]
Link:
https://lkml.kernel.org/r/20201001152259.14932-1-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link:
https://lkml.kernel.org/r/20200908195539.25896-3-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c
patch
|
blob
|
history
diff --git
a/mm/memory.c
b/mm/memory.c
index
2afb01e
..
589afe4
100644
(file)
--- a/
mm/memory.c
+++ b/
mm/memory.c
@@
-3709,13
+3709,14
@@
static vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page)
unsigned long haddr = vmf->address & HPAGE_PMD_MASK;
pmd_t entry;
int i;
- vm_fault_t ret;
+ vm_fault_t ret
= VM_FAULT_FALLBACK
;
if (!transhuge_vma_suitable(vma, haddr))
- return
VM_FAULT_FALLBACK
;
+ return
ret
;
- ret = VM_FAULT_FALLBACK;
page = compound_head(page);
+ if (compound_order(page) != HPAGE_PMD_ORDER)
+ return ret;
/*
* Archs like ppc64 need additonal space to store information