diff options
author | Mike Kravetz <mike.kravetz@oracle.com> | 2022-05-24 23:50:03 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 19:11:48 +0300 |
commit | 6f4a489d8458a93b5efdbb7ca439dfeef8d9d7a1 (patch) | |
tree | e22defcde26ed6017a55c7280177f2d8f7b46470 /mm/mincore.c | |
parent | 73bdb2359dbc260364141c83dd1e1a5497f29d3d (diff) | |
download | linux-6f4a489d8458a93b5efdbb7ca439dfeef8d9d7a1.tar.xz |
hugetlb: fix huge_pmd_unshare address update
commit 48381273f8734d28ef56a5bdf1966dd8530111bc upstream.
The routine huge_pmd_unshare() is passed a pointer to an address
associated with an area which may be unshared. If unshare is successful
this address is updated to 'optimize' callers iterating over huge page
addresses. For the optimization to work correctly, address should be
updated to the last huge page in the unmapped/unshared area. However, in
the common case where the passed address is PUD_SIZE aligned, the address
is incorrectly updated to the address of the preceding huge page. That
wastes CPU cycles as the unmapped/unshared range is scanned twice.
Link: https://lkml.kernel.org/r/20220524205003.126184-1-mike.kravetz@oracle.com
Fixes: 39dde65c9940 ("shared page table for hugetlb page")
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/mincore.c')
0 files changed, 0 insertions, 0 deletions