Centos-kernel-stream-9/mm
David Hildenbrand 322c4f0efc drivers/base/node: rename link_mem_sections() to register_memory_block_under_node()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2077436

commit cc6515591b25f08ce199e9379844a964f52a27f2
Author: David Hildenbrand <david@redhat.com>
Date:   Tue Mar 22 14:47:28 2022 -0700

    drivers/base/node: rename link_mem_sections() to register_memory_block_under_node()

    Patch series "drivers/base/memory: determine and store zone for single-zone memory blocks", v2.

    I remember talking to Michal in the past about removing
    test_pages_in_a_zone(), which we use for:
    * verifying that a memory block we intend to offline is really only managed
      by a single zone. We don't support offlining of memory blocks that are
      managed by multiple zones (e.g., multiple nodes, DMA and DMA32)
    * exposing that zone to user space via
      /sys/devices/system/memory/memory*/valid_zones

    Now that I identified some more cases where test_pages_in_a_zone() might
    go wrong, and we received an UBSAN report (see patch #3), let's get rid of
    this PFN walker.

    So instead of detecting the zone at runtime with test_pages_in_a_zone() by
    scanning the memmap, let's determine and remember for each memory block if
    it's managed by a single zone.  The stored zone can then be used for the
    above two cases, avoiding a manual lookup using test_pages_in_a_zone().

    This avoids eventually stumbling over uninitialized memmaps in corner
    cases, especially when ZONE_DEVICE ranges partly fall into memory block
    (that are responsible for managing System RAM).

    Handling memory onlining is easy, because we online to exactly one zone.
    Handling boot memory is more tricky, because we want to avoid scanning all
    zones of all nodes to detect possible zones that overlap with the physical
    memory region of interest.  Fortunately, we already have code that
    determines the applicable nodes for a memory block, to create sysfs links
    -- we'll hook into that.

    Patch #1 is a simple cleanup I had laying around for a longer time.
    Patch #2 contains the main logic to remove test_pages_in_a_zone() and
    further details.

    [1] https://lkml.kernel.org/r/20220128144540.153902-1-david@redhat.com
    [2] https://lkml.kernel.org/r/20220203105212.30385-1-david@redhat.com

    This patch (of 2):

    Let's adjust the stale terminology, making it match
    unregister_memory_block_under_nodes() and
    do_register_memory_block_under_node().  We're dealing with memory block
    devices, which span 1..X memory sections.

    Link: https://lkml.kernel.org/r/20220210184359.235565-1-david@redhat.com
    Link: https://lkml.kernel.org/r/20220210184359.235565-2-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Acked-by: Oscar Salvador <osalvador@suse.de>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: "Rafael J. Wysocki" <rafael@kernel.org>
    Cc: Rafael Parra <rparrazo@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
2022-04-21 17:04:04 +02:00
..
damon mm/damon/vaddr-test: split a test function having >1024 bytes frame size 2022-02-02 18:47:40 -05:00
kasan kasan: fix quarantine conflicting with init_on_free 2022-03-27 00:48:30 -04:00
kfence kfence: fix memory leak when cat kfence objects 2022-03-27 00:48:25 -04:00
Kconfig mm: disable NUMA_BALANCING_DEFAULT_ENABLED and TRANSPARENT_HUGEPAGE on PREEMPT_RT 2022-03-27 00:48:07 -04:00
Kconfig.debug
Makefile mm: introduce Data Access MONitor (DAMON) 2021-11-29 11:43:21 -05:00
backing-dev.c mm: don't include <linux/blkdev.h> in <linux/backing-dev.h> 2021-12-06 16:42:47 +08:00
balloon_compaction.c
bootmem_info.c mm/bootmem_info.c: mark __init on register_page_bootmem_info_section 2021-11-29 11:41:36 -05:00
cleancache.c
cma.c mm/cma: provide option to opt out from exposing pages on activation failure 2022-02-11 12:34:50 -05:00
cma.h mm/cma: provide option to opt out from exposing pages on activation failure 2022-02-11 12:34:50 -05:00
cma_debug.c
cma_sysfs.c
compaction.c mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE 2021-11-29 11:43:02 -05:00
debug.c mm/debug: sync up latest migrate_reason to migrate_reason_names 2021-11-29 11:43:56 -05:00
debug_page_ref.c
debug_vm_pgtable.c mm/debug_vm_pgtable: remove pte entry from the page table 2022-03-27 00:48:31 -04:00
dmapool.c
early_ioremap.c mm/early_ioremap.c: remove redundant early_ioremap_shutdown() 2021-11-29 11:43:16 -05:00
fadvise.c
failslab.c
filemap.c mm: move filemap_range_needs_writeback() into header 2022-04-11 11:44:25 +08:00
frontswap.c
gup.c Revert "mm/gup: small refactoring: simplify try_grab_page()" 2022-03-27 00:48:30 -04:00
gup_test.c
gup_test.h
highmem.c mm: remove spurious blkdev.h includes 2021-12-06 16:42:47 +08:00
hmm.c mm/hmm: bypass devmap pte when all pfn requested flags are fulfilled 2021-11-29 11:43:40 -05:00
huge_memory.c mm/thp: refix __split_huge_pmd_locked() for migration PMD 2022-03-27 00:48:46 -04:00
hugetlb.c hugetlb, userfaultfd: fix reservation restore on userfaultfd error 2022-03-27 00:48:22 -04:00
hugetlb_cgroup.c
hugetlb_vmemmap.c
hugetlb_vmemmap.h
hwpoison-inject.c mm: hwpoison: don't drop slab caches for offlining non-LRU page 2021-11-29 11:41:59 -05:00
init-mm.c mm: add setup_initial_init_mm() helper 2021-07-08 11:48:21 -07:00
internal.h mm: handle uninitialized numa nodes gracefully 2022-03-28 12:41:38 -06:00
interval_tree.c
io-mapping.c
ioremap.c mm: move ioremap_page_range to vmalloc.c 2021-11-29 11:43:15 -05:00
khugepaged.c mm: khugepaged: skip huge page collapse for special files 2021-11-29 11:44:17 -05:00
kmemleak.c mm/kmemleak: allow __GFP_NOLOCKDEP passed to kmemleak's gfp 2021-11-29 11:43:43 -05:00
ksm.c mm: COW: restore full accuracy in page reuse 2021-12-22 19:50:37 -05:00
list_lru.c
maccess.c ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault 2021-11-29 11:40:28 -05:00
madvise.c mm: madvise: return correct bytes advised with process_madvise 2022-03-27 00:48:47 -04:00
mapping_dirty_helpers.c
memblock.c memblock: exclude MEMBLOCK_NOMAP regions from kmemleak 2021-11-29 11:44:11 -05:00
memcontrol.c Merge: Preallocate pgdat struct for all nodes during boot 2022-04-19 12:23:39 +02:00
memfd.c
memory-failure.c mm/hwpoison: fix error page recovered but reported "not recovered" 2022-03-27 00:48:44 -04:00
memory.c mm: COW: restore full accuracy in page reuse 2021-12-22 19:50:37 -05:00
memory_hotplug.c drivers/base/node: rename link_mem_sections() to register_memory_block_under_node() 2022-04-21 17:04:04 +02:00
mempolicy.c mm: mempolicy: fix THP allocations escaping mempolicy restrictions 2022-03-27 00:48:25 -04:00
mempool.c mm: remove spurious blkdev.h includes 2021-12-06 16:42:47 +08:00
memremap.c mm/memory_hotplug: remove nid parameter from arch_remove_memory() 2021-11-29 11:43:05 -05:00
memtest.c
migrate.c mm/migrate: fix CPUHP state to update node demotion order 2021-11-29 11:44:03 -05:00
mincore.c
mlock.c mm/mlock: fix potential imbalanced rlimit ucounts adjustment 2022-03-27 00:48:45 -04:00
mm_init.c
mmap.c remap_file_pages: Use vma_lookup() instead of find_vma() 2021-11-29 11:41:35 -05:00
mmap_lock.c mm: mmap_lock: fix disabling preemption directly 2021-07-23 17:43:28 -07:00
mmu_gather.c
mmu_notifier.c
mmzone.c
mprotect.c mm: don't try to NUMA-migrate COW pages that have other uses 2022-03-27 00:48:32 -04:00
mremap.c mm/mremap: don't account pages in vma_to_resize() 2022-03-27 00:48:10 -04:00
msync.c
nommu.c mm: remove spurious blkdev.h includes 2021-12-06 16:42:47 +08:00
oom_kill.c mm/oom_kill.c: prevent a race between process_mrelease and exit_mmap 2021-11-29 11:44:15 -05:00
page-writeback.c writeback: use READ_ONCE for unlocked reads of writeback stats 2021-11-29 11:40:49 -05:00
page_alloc.c Merge: Preallocate pgdat struct for all nodes during boot 2022-04-19 12:23:39 +02:00
page_counter.c
page_ext.c mm/migrate: add CPU hotplug to demotion #ifdef 2021-11-29 11:44:02 -05:00
page_idle.c mm/idle_page_tracking: make PG_idle reusable 2021-11-29 11:43:23 -05:00
page_io.c block: add a struct io_comp_batch argument to fops->iopoll() 2021-12-06 16:44:47 +08:00
page_isolation.c mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE 2021-11-29 11:43:02 -05:00
page_owner.c mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE 2021-11-29 11:43:02 -05:00
page_poison.c
page_reporting.c
page_reporting.h
page_vma_mapped.c
pagewalk.c
percpu-internal.h
percpu-km.c
percpu-stats.c mm: use vmalloc_array and vcalloc for array allocations 2022-03-16 12:20:11 +01:00
percpu-vm.c
percpu.c percpu: remove export of pcpu_base_addr 2021-11-29 11:43:30 -05:00
pgalloc-track.h
pgtable-generic.c
process_vm_access.c
ptdump.c
readahead.c mm: remove spurious blkdev.h includes 2021-12-06 16:42:47 +08:00
rmap.c mm: thp: stabilize the THP mapcount in page_remove_anon_compound_rmap 2021-12-22 19:50:11 -05:00
rodata_test.c
secretmem.c mm/secretmem: avoid letting secretmem_users drop to zero 2021-11-29 11:44:15 -05:00
shmem.c mm: remove spurious blkdev.h includes 2021-12-06 16:42:47 +08:00
shuffle.c
shuffle.h
slab.c mm/slab.c: remove useless lines in enable_cpucache() 2022-03-27 00:48:03 -04:00
slab.h mm/memcg: fix NULL pointer dereference in memcg_slab_free_hook() 2021-07-30 10:14:39 -07:00
slab_common.c kasan: add ability to detect double-kmem_cache_destroy() 2022-03-27 00:48:28 -04:00
slob.c
slub.c mm/slub: fix endianness bug for alloc/free_traces attributes 2022-03-27 00:48:23 -04:00
sparse-vmemmap.c
sparse.c mm: introduce memmap_alloc() to unify memory map allocation 2021-11-29 11:41:51 -05:00
swap.c mm: fs: invalidate bh_lrus for only cold path 2021-11-29 11:43:55 -05:00
swap_cgroup.c mm: use vmalloc_array and vcalloc for array allocations 2022-03-16 12:20:11 +01:00
swap_slots.c mm: Replace deprecated CPU-hotplug functions. 2021-11-12 14:23:21 -05:00
swap_state.c mm: COW: restore full accuracy in page reuse 2021-12-22 19:50:37 -05:00
swapfile.c mm: gup: gup_must_unshare() use can_read_pin_swap_page() 2021-12-22 19:50:23 -05:00
truncate.c fs: inode: count invalidated shadow pages in pginodesteal 2021-11-29 11:40:53 -05:00
usercopy.c mm/usercopy: return 1 from hardened_usercopy __setup() handler 2022-03-27 00:48:47 -04:00
userfaultfd.c userfaultfd: change mmap_changing to atomic 2021-11-29 11:42:04 -05:00
util.c Merge: Merge tag 'kernel-5.14.0-70.5.1.el9_0' from 9.0 2022-04-07 11:08:06 +00:00
vmacache.c
vmalloc.c mm/vmalloc: be more explicit about supported gfp flags 2022-03-27 00:48:16 -04:00
vmpressure.c mm/vmpressure: replace vmpressure_to_css() with vmpressure_to_memcg() 2021-11-29 11:42:13 -05:00
vmscan.c mm: COW: restore full accuracy in page reuse 2021-12-22 19:50:37 -05:00
vmstat.c mm: move fold_vm_numa_events() to fix NUMA without SMP 2022-03-27 00:48:19 -04:00
workingset.c memcg: flush lruvec stats in the refault 2021-11-29 11:43:51 -05:00
z3fold.c
zbud.c
zpool.c
zsmalloc.c mm/zsmalloc.c: close race window between zs_pool_dec_isolated() and zs_unregister_migration() 2022-03-27 00:48:21 -04:00
zswap.c