Centos-kernel-stream-9/drivers/base
Jan Stancek a31c68cbfe Merge: cacheinfo: Fix sleep in atomic context on PREEMPT_RT kernels
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2451

Bugzilla: https://bugzilla.redhat.com/2180619

This MR changes the cacheinfo memory allocation behavior to avoid a
kmalloc in atomic context during initialization, which would otherwise
trigger a splat on PREEMPT_RT kernels.

Originally, cacheinfo memory corresponding to secondary CPUs was
allocated by code running on the secondary CPU itself. For arm64 CPUs,
this makes it possible to *detect* the number of caches by looking at
local CPU registers (e.g. clidr_el1) and size the allocated memory
accordingly. Otherwise, the information must be provided by the DT or
ACPI tables. The problem is that cacheinfo memory allocation happens
very early for secondary CPUs, while the CPU is still in non preemptible
context. On PREEMPT_RT kernels, kmalloc can sleep, even with GFP_ATOMIC.

To address this issue, multiple patches and patch series have been
ported from upstream. To summarize, this MR has 3 major parts:
  1. A patch series that moves cacheinfo memory allocation to the
     primary CPU when the number of caches is described in the DT or
     ACPI tables. In the absence of such information, memory is still
     allocated on the secondary CPU.
  2. A patch series that allocates cacheinfo memory on the primary CPU
     even when the DT/ACPI info is missing and assumes that secondary
     CPUs have the same number of caches as the primary CPU, which is
     true for symmetric CPUs. Detection still runs on the secondary
     CPU, and a correction (reallocation) is applied if the initial
     guess proves to be wrong.
  3. A patch series that fixes some corner cases and ensures the number
     of shared caches (between CPUs) is always accounted for correctly
     when automatic detection is used on arm64 CPUs.

The rest of the patches in this MR are support patches to make the
above patch series apply cleanly to the CentOS Stream 9 kernel and
compile and work as expected.

Ultimately, this MR aims to eliminate the kmalloc splat on PREEMPT_RT
kernels without requiring additional cacheinfo related information to be
added to DT/ACPI on systems with symmetric CPUs.

Signed-off-by: Radu Rendec <rrendec@redhat.com>

Approved-by: Eric Chanudet <echanude@redhat.com>
Approved-by: Adrien Thierry <athierry@redhat.com>
Approved-by: Mark Langsdorf <mlangsdo@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-05-10 10:51:47 +02:00
..
firmware_loader firmware_loader: Fix memory leak in firmware upload 2022-10-25 15:20:23 -04:00
power PM: domains: Store the next hrtimer wakeup in genpd 2023-01-10 15:18:55 -05:00
regmap regmap: Constify static regmap_bus structs 2022-11-03 15:17:17 +01:00
test
Kconfig
Makefile genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2023-03-13 09:52:38 -04:00
arch_numa.c
arch_topology.c arch_topology: Remove early cacheinfo error message if -ENOENT 2023-05-04 17:28:09 -04:00
attribute_container.c
auxiliary.c
base.h
bus.c
cacheinfo.c cacheinfo: Add use_arch[|_cache]_info field/function 2023-05-04 17:28:09 -04:00
class.c
component.c
container.c
core.c Merge branch 'main' into 'guilt/pmem-9.2' 2023-03-30 20:35:46 +00:00
cpu.c
dd.c driver core: Set default deferred_probe_timeout back to 0. 2022-10-25 15:20:18 -04:00
devcoredump.c
devres.c
devtmpfs.c
driver.c driver core: fix driver_set_override() issue with empty strings 2022-10-25 15:18:46 -04:00
firmware.c
hypervisor.c
init.c init: Initialize noop_backing_dev_info early 2022-11-08 10:11:38 -07:00
isa.c
map.c
memory.c Merge: Update drivers/base to match Linux v6.0 2022-12-21 12:03:57 -03:00
module.c
node.c mm: add NR_SECONDARY_PAGETABLE to count secondary page table uses. 2023-05-04 18:25:10 +02:00
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced 2023-03-13 09:52:45 -04:00
platform.c
property.c
soc.c
swnode.c
syscore.c
topology.c
trace.c
trace.h
transport_class.c