lkml.org 
[lkml]   [2020]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v6 37/51] mm: Remove page fault assumption of compound page size
    Date
    From: "Matthew Wilcox (Oracle)" <willy@infradead.org>

    A compound page in the page cache will not necessarily be of PMD size,
    so check explicitly.

    Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    ---
    mm/memory.c | 7 ++++---
    1 file changed, 4 insertions(+), 3 deletions(-)

    diff --git a/mm/memory.c b/mm/memory.c
    index dc7f3543b1fd..3e6ef0ebfdd0 100644
    --- a/mm/memory.c
    +++ b/mm/memory.c
    @@ -3552,13 +3552,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 (page_order(page) != HPAGE_PMD_ORDER)
    + return ret;

    /*
    * Archs like ppc64 need additonal space to store information
    --
    2.26.2
    \
     
     \ /
      Last update: 2020-06-10 22:16    [W:4.288 / U:0.616 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site