Centos-kernel-stream-9/drivers
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
..
accessibility
acpi Merge: Update kernel's PCI subsystem to v5.15 2022-04-07 11:01:45 +00:00
amba
android
ata
atm
auxdisplay
base drivers/base/node: rename link_mem_sections() to register_memory_block_under_node() 2022-04-21 17:04:04 +02:00
bcma bcma: simplify reference to driver name 2022-04-12 08:21:47 -06:00
block block: loop:use kstatfs.f_bsize of backing file to set discard granularity 2022-04-11 11:44:35 +08:00
bluetooth
bus bus: mhi: core: Use correctly sized arguments for bit field 2022-02-21 11:40:46 +01:00
cdrom block: remove GENHD_FL_EXT_DEVT 2022-04-11 11:44:18 +08:00
char Merge tag 'kernel-5.14.0-70.5.1.el9_0' from 9.0 2022-03-30 16:41:04 -03:00
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto crypto: hisilicon - use dev_driver_string() instead of pci_dev->driver->name 2022-04-12 08:21:47 -06:00
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac x86/MCE/AMD, EDAC/mce_amd: Support non-uniform MCA bank type enumeration 2022-03-03 10:20:47 -05:00
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu Merge: RDMA: update to v5.17 2022-04-19 12:23:29 +02:00
greybus
hid
hsi
hv Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device 2022-04-11 15:56:53 +02:00
hwmon mm: move kvmalloc-related functions to slab.h 2022-03-27 00:48:02 -04:00
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband Merge: RDMA: update to v5.17 2022-04-19 12:23:29 +02:00
input
interconnect
iommu Merge: [RHEL9.0 BZ2053219] amd/iommu: Fix I/O page table memory leak and recover from event log overflow 2022-04-01 18:58:32 +00:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md block: remove the ->rq_disk field in struct request 2022-04-11 11:44:24 +08:00
media
memory
memstick
message scsi: message: fusion: Remove unused mpt_pci driver .probe() 'id' parameter 2022-04-12 08:21:47 -06:00
mfd platform/x86/intel: Move intel_pmt from MFD to Auxiliary Bus 2022-03-17 12:15:22 -04:00
misc cxl: Use to_pci_driver() instead of pci_dev->driver 2022-04-12 08:21:49 -06:00
mmc block: remove the gendisk argument to blk_execute_rq 2022-04-11 11:44:25 +08:00
most
mtd mtd_blkdevs: don't scan partitions for plain mtdblock 2022-04-11 11:44:27 +08:00
mux
net Merge: Merge up tags kernel-5.14.0-70.11.1.el9_0 to kernel-5.14.0-70.12.1.el9_0 2022-04-19 12:29:05 +02:00
nfc
ntb
nubus
nvdimm
nvme nvme-pci: fix queue_rqs list splitting 2022-04-11 11:44:31 +08:00
nvmem
of mm: move kvmalloc-related functions to slab.h 2022-03-27 00:48:02 -04:00
opp
parisc
parport
pci Merge: Drivers: hv: Propagate VMBus coherence for performance 2022-04-19 12:24:06 +02:00
pcmcia
perf
phy
pinctrl
platform platform/x86/intel: Move intel_pmt from MFD to Auxiliary Bus 2022-03-17 12:15:22 -04:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 Merge: CNB: ethtool: update ethtool core to upstream v5.16 2022-04-04 09:15:27 +00:00
sbus
scsi Merge tag 'kernel-5.14.0-70.13.1.el9_0' from 9.0 2022-04-19 18:37:37 -03:00
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb ssb: Use dev_driver_string() instead of pci_dev->driver->name 2022-04-12 08:21:47 -06:00
staging PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver 2022-04-12 08:49:34 -06:00
target block: remove the gendisk argument to blk_execute_rq 2022-04-11 11:44:25 +08:00
tc
tee
thermal thermal: int340x: Fix VCoRefLow MMIO bit offset for TGL 2022-03-17 13:10:52 -04:00
thunderbolt
tty
uio
usb Merge: block: update to v5.17 2022-04-19 12:23:36 +02:00
vdpa vdpa/mlx5: Fix tracking of current number of VQs 2022-03-19 09:54:41 +08:00
vfio
vhost vdpa: Protect vdpa reset with cf_mutex 2022-03-19 09:54:40 +08:00
video
virt
virtio vdpa: Allow to configure max data virtqueues 2022-03-19 09:54:39 +08:00
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig remove the lightnvm subsystem 2022-03-27 12:46:53 +05:30
Makefile Merge: Update nvme to upstream 5.17-rc8 2022-04-04 09:20:00 +00:00