• Gerald Schaefer's avatar
    s390/mm: handle PTE-mapped tail pages in fast gup · fc897c95
    Gerald Schaefer authored
    With the THP refcounting rework it is possible to see THP compound tail
    pages mapped with PTEs during a THP split. This needs to be considered
    when using page_cache_get_speculative(), which will always fail on tail
    pages because ->_count is always zero. commit 7aef4172 "mm: handle
    PTE-mapped tail pages in gerneric fast gup implementaiton" fixed it for
    the generic fast gup code by using compound_head(page) instead of page,
    but not for s390.
    
    This patch is a 1:1 adaption of commit 7aef4172 for the s390 fast gup
    code. Without this fix, gup will fall back to the slow path or fail
    in the unlikely scenario that we hit a THP under splitting in-between
    the page table split and the compound page split.
    
    Cc: stable@vger.kernel.org # v4.5
    Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    fc897c95
gup.c 5.87 KB