]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/mm: handle PTE-mapped tail pages in fast gup
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Thu, 17 Mar 2016 14:00:04 +0000 (15:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:45:07 +0000 (15:45 +0900)
commit37828ff8b8d1437a0165c6373608d7715bb63fc9
tree84dfd2492672ed7c16b9c83b6dc220ca182095d1
parent0e345ced4b17c379dc91f8117e920fd40fa9f06f
s390/mm: handle PTE-mapped tail pages in fast gup

commit fc897c95e91451271cd707ee0f71022b9b201ce9 upstream.

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.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/mm/gup.c