Mike Kravetz
6f4a489d84
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: 39dde65c99 ("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>
2022-06-14 18:11:48 +02:00
..
kasan
kasan: fix incorrect arguments passing in kasan_add_zero_shadow
2021-01-27 11:47:53 +01:00
backing-dev.c
mm: bdi: initialize bdi_min_ratio when bdi is unregistered
2021-12-14 14:49:00 +01:00
balloon_compaction.c
cleancache.c
cma.c
cma.h
cma_debug.c
compaction.c
mm, compaction: fast_find_migrateblock() should return pfn in the target zone
2022-06-14 18:11:46 +02:00
debug.c
debug_page_ref.c
dmapool.c
early_ioremap.c
fadvise.c
failslab.c
filemap.c
mm/filemap: fix storing to a THP shadow entry
2021-06-10 13:37:15 +02:00
frame_vector.c
frontswap.c
gup.c
gup_benchmark.c
highmem.c
hmm.c
huge_memory.c
mm/huge_memory.c: don't discard hugepage if other processes are mapping it
2021-07-14 16:53:47 +02:00
hugetlb.c
hugetlb: fix huge_pmd_unshare address update
2022-06-14 18:11:48 +02:00
hugetlb_cgroup.c
hwpoison-inject.c
init-mm.c
internal.h
mm/thp: fix vma_address() if virtual address below file offset
2021-06-30 08:47:52 -04:00
interval_tree.c
Kconfig
mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING
2020-12-16 10:56:59 +01:00
Kconfig.debug
khugepaged.c
khugepaged: fix wrong result value for trace_mm_collapse_huge_page_isolate()
2021-05-19 10:08:27 +02:00
kmemleak-test.c
kmemleak.c
mm: kmemleak: take a full lowmem check in kmemleak_*_phys()
2022-04-20 09:19:38 +02:00
ksm.c
ksm: fix potential missing rmap_item for stable_node
2021-05-19 10:08:27 +02:00
list_lru.c
mm: list_lru: set shrinker map bit when child nr_items is not zero
2020-12-11 13:23:31 +01:00
maccess.c
madvise.c
Makefile
memblock.c
memblock: use kfree() to release kmalloced memblock regions
2022-03-02 11:41:18 +01:00
memcontrol.c
mm/memcontrol: return 1 from cgroup.memory __setup() handler
2022-04-15 14:18:29 +02:00
memfd.c
memfd: fix F_SEAL_WRITE after shmem huge page allocated
2022-03-08 19:07:49 +01:00
memory-failure.c
mm/memory-failure: make sure wait for page writeback in memory_failure
2021-06-23 14:41:23 +02:00
memory.c
mm: hugetlb: fix missing cache flush in copy_huge_page_from_user()
2022-05-15 19:54:47 +02:00
memory_hotplug.c
mm/memory_hotplug: use "unsigned long" for PFN in zone_for_pfn_range()
2021-09-22 12:26:43 +02:00
mempolicy.c
mm/mempolicy: fix mpol_new leak in shared_policy_replace
2022-04-15 14:18:39 +02:00
mempool.c
memremap.c
memtest.c
migrate.c
mm: fix missing cache flush for all tail pages of compound page
2022-05-15 19:54:47 +02:00
mincore.c
mlock.c
mm_init.c
mmap.c
mm, hugetlb: allow for "high" userspace addresses
2022-05-09 09:03:28 +02:00
mmu_context.c
mmu_gather.c
mmu_notifier.c
mmzone.c
arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
2022-05-15 19:54:46 +02:00
mprotect.c
mremap.c
mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0)
2022-04-15 14:18:39 +02:00
msync.c
nommu.c
oom_kill.c
oom_kill.c: futex: delay the OOM reaper to allow time for proper futex cleanup
2022-04-27 13:50:48 +02:00
page-writeback.c
page_alloc.c
mm: page_alloc: fix building error on -Werror=array-compare
2022-04-27 13:50:45 +02:00
page_counter.c
page_ext.c
page_idle.c
page_io.c
mm: fix unexpected zeroed page mapping with zram swap
2022-05-12 12:23:48 +02:00
page_isolation.c
page_owner.c
mm/page_owner: change split_page_owner to take a count
2020-10-29 09:57:52 +01:00
page_poison.c
page_vma_mapped.c
mm/thp: another PVMW_SYNC fix in page_vma_mapped_walk()
2021-06-30 08:47:55 -04:00
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c
percpu-vm.c
percpu.c
pgtable-generic.c
mm/thp: fix __split_huge_pmd_locked() on shmem migration entry
2021-06-30 08:47:52 -04:00
process_vm_access.c
readahead.c
rmap.c
mm: fix race between MADV_FREE reclaim and blkdev direct IO read
2022-04-15 14:18:36 +02:00
rodata_test.c
shmem.c
shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode
2022-01-27 09:19:29 +01:00
shuffle.c
shuffle.h
slab.c
slab.h
mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag
2021-11-26 10:47:21 +01:00
slab_common.c
mm: slab: fix kmem_cache_create failed when sysfs node not destroyed
2021-07-25 14:35:14 +02:00
slob.c
slub.c
mm, slub: fix potential memoryleak in kmem_cache_open()
2021-10-27 09:54:28 +02:00
sparse-vmemmap.c
sparse.c
mm/sparse: add the missing sparse_buffer_fini() in error branch
2021-05-14 09:44:32 +02:00
swap.c
swap_cgroup.c
swap_slots.c
swap_state.c
swapfile.c
swap: fix swapfile read/write offset
2021-03-07 12:20:49 +01:00
truncate.c
mm/thp: unmap_mapping_page() to fix THP truncate_cleanup_page()
2021-06-30 08:47:53 -04:00
usercopy.c
mm/usercopy: return 1 from hardened_usercopy __setup() handler
2022-04-15 14:18:30 +02:00
userfaultfd.c
mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic()
2022-05-15 19:54:47 +02:00
util.c
vmacache.c
vmalloc.c
vmpressure.c
vmscan.c
mm,vmscan: fix divide by zero in get_scan_count
2021-09-22 12:26:37 +02:00
vmstat.c
arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
2022-05-15 19:54:46 +02:00
workingset.c
z3fold.c
mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
2021-07-14 16:53:47 +02:00
zbud.c
zpool.c
zsmalloc.c
zsmalloc: fix races between asynchronous zspage free and page migration
2022-06-06 08:33:50 +02:00
zswap.c