init_cache_level() no longer has a purpose on x86. It no longer needs to
set num_leaves, and it never had to set num_levels, which was unnecessary
on x86.
Replace it with "return 0" simply to override the weak function, which
would return an error.
Cc: Andreas Herrmann <email address hidden>
Cc: Catalin Marinas <email address hidden>
Cc: Chen Yu <email address hidden>
CC: Huang Ying <email address hidden>
Cc: Len Brown <email address hidden>
Cc: Radu Rendec <email address hidden>
Cc: Pierre Gondois <email address hidden>
Cc: Pu Wen <email address hidden>
Cc: "Rafael J. Wysocki" <email address hidden>
Cc: Sudeep Holla <email address hidden>
Cc: Srinivas Pandruvada <email address hidden>
Cc: Will Deacon <email address hidden>
Cc: Zhang Rui <email address hidden>
Cc: <email address hidden>
Cc: <email address hidden>
Reviewed-by: Len Brown <email address hidden>
Signed-off-by: Ricardo Neri <email address hidden>
(cherry-picked from https://<email address hidden>/raw)
Signed-off-by: You-Sheng Yang <email address hidden>
Linux remembers cpu_cachinfo::num_leaves per CPU, but x86 initializes all
CPUs from the same global "num_cache_leaves".
This is erroneous on systems such as Meteor Lake, where each CPU has a
distinct num_leaves value. Delete the global "num_cache_leaves" and
initialize num_leaves on each CPU.
Cc: Andreas Herrmann <email address hidden>
Cc: Catalin Marinas <email address hidden>
Cc: Chen Yu <email address hidden>
Cc: Huang Ying <email address hidden>
Cc: Len Brown <email address hidden>
Cc: Radu Rendec <email address hidden>
Cc: Pierre Gondois <email address hidden>
Cc: Pu Wen <email address hidden>
Cc: "Rafael J. Wysocki" <email address hidden>
Cc: Sudeep Holla <email address hidden>
Cc: Srinivas Pandruvada <email address hidden>
Cc: Will Deacon <email address hidden>
Cc: Zhang Rui <email address hidden>
Cc: <email address hidden>
Cc: <email address hidden>
Reviewed-by: Len Brown <email address hidden>
Signed-off-by: Ricardo Neri <email address hidden>
(cherry-picked from https://<email address hidden>/raw)
Signed-off-by: You-Sheng Yang <email address hidden>
Commit 5944ce092b97 ("arch_topology: Build cacheinfo from primary CPU")
adds functionality that architectures can use to optionally allocate and
build cacheinfo early during boot. Commit 6539cffa9495 ("cacheinfo: Add
arch specific early level initializer") lets secondary CPUs correct (and
reallocate memory) cacheinfo data if needed.
If the early build functionality is not used and cacheinfo does not need
correction, memory for cacheinfo is never allocated. x86 does not use the
early build functionality. Consequently, during the cacheinfo CPU hotplug
callback, last_level_cache_is_valid() attempts to dereference a NULL
pointer:
Before determining the validity of the last-level cache info, ensure that
it has been allocated. Simply checking for non-zero cache_leaves() is not
sufficient, as some architectures (e.g., Intel processors) have non-zero
cache_leaves() before allocation.
Dereferencing NULL cacheinfo can occur in update_per_cpu_data_slice_size().
This function iterates over all online CPUs. However, a CPU may have come
online recently, but its cacheinfo may not have been allocated yet.
Pull more bcachefs updates from Kent Overstreet:
"Some fixes, Some refactoring, some minor features:
- Assorted prep work for disk space accounting rewrite
- BTREE_TRIGGER_ATOMIC: after combining our trigger callbacks, this
makes our trigger context more explicit
- A few fixes to avoid excessive transaction restarts on
multithreaded workloads: fstests (in addition to ktest tests) are
now checking slowpath counters, and that's shaking out a few bugs
- Assorted tracepoint improvements
- Starting to break up bcachefs_format.h and move on disk types so
they're with the code they belong to; this will make room to start
documenting the on disk format better.
- A few minor fixes"
* tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs: (46 commits)
bcachefs: Improve inode_to_text()
bcachefs: logged_ops_format.h
bcachefs: reflink_format.h
bcachefs; extents_format.h
bcachefs: ec_format.h
bcachefs: subvolume_format.h
bcachefs: snapshot_format.h
bcachefs: alloc_background_format.h
bcachefs: xattr_format.h
bcachefs: dirent_format.h
bcachefs: inode_format.h
bcachefs; quota_format.h
bcachefs: sb-counters_format.h
bcachefs: counters.c -> sb-counters.c
bcachefs: comment bch_subvolume
bcachefs: bch_snapshot::btime
bcachefs: add missing __GFP_NOWARN
bcachefs: opts->compression can now also be applied in the background
bcachefs: Prep work for variable size btree node buffers
bcachefs: grab s_umount only if snapshotting
...
4fbbed7...
by
Linus Torvalds <email address hidden>
Merge tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner:
"Updates for time and clocksources:
- A fix for the idle and iowait time accounting vs CPU hotplug.
The time is reset on CPU hotplug which makes the accumulated
systemwide time jump backwards.
- Assorted fixes and improvements for clocksource/event drivers"
* tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
clocksource/drivers/ep93xx: Fix error handling during probe
clocksource/drivers/cadence-ttc: Fix some kernel-doc warnings
clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
clocksource/timer-riscv: Add riscv_clock_shutdown callback
dt-bindings: timer: Add StarFive JH8100 clint
dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs
7b297a5...
by
Linus Torvalds <email address hidden>
Merge tag 'powerpc-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Aneesh Kumar:
- Increase default stack size to 32KB for Book3S
Thanks to Michael Ellerman.
* tag 'powerpc-6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64s: Increase default stack size to 32KB
249f441...
by
Kent Overstreet <email address hidden>
bcachefs: Improve inode_to_text()
Add line breaks - inode_to_text() is now much easier to read.
Signed-off-by: Kent Overstreet <email address hidden>
d826cc5...
by
Kent Overstreet <email address hidden>
bcachefs: logged_ops_format.h
Signed-off-by: Kent Overstreet <email address hidden>