Skip to content

Commit e406d57

Browse files
committed
Merge tag 'mm-nonmm-stable-2025-10-02-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-MM updates from Andrew Morton: - "ida: Remove the ida_simple_xxx() API" from Christophe Jaillet completes the removal of this legacy IDR API - "panic: introduce panic status function family" from Jinchao Wang provides a number of cleanups to the panic code and its various helpers, which were rather ad-hoc and scattered all over the place - "tools/delaytop: implement real-time keyboard interaction support" from Fan Yu adds a few nice user-facing usability changes to the delaytop monitoring tool - "efi: Fix EFI boot with kexec handover (KHO)" from Evangelos Petrongonas fixes a panic which was happening with the combination of EFI and KHO - "Squashfs: performance improvement and a sanity check" from Phillip Lougher teaches squashfs's lseek() about SEEK_DATA/SEEK_HOLE. A mere 150x speedup was measured for a well-chosen microbenchmark - plus another 50-odd singleton patches all over the place * tag 'mm-nonmm-stable-2025-10-02-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (75 commits) Squashfs: reject negative file sizes in squashfs_read_inode() kallsyms: use kmalloc_array() instead of kmalloc() MAINTAINERS: update Sibi Sankar's email address Squashfs: add SEEK_DATA/SEEK_HOLE support Squashfs: add additional inode sanity checking lib/genalloc: fix device leak in of_gen_pool_get() panic: remove CONFIG_PANIC_ON_OOPS_VALUE ocfs2: fix double free in user_cluster_connect() checkpatch: suppress strscpy warnings for userspace tools cramfs: fix incorrect physical page address calculation kernel: prevent prctl(PR_SET_PDEATHSIG) from racing with parent process exit Squashfs: fix uninit-value in squashfs_get_parent kho: only fill kimage if KHO is finalized ocfs2: avoid extra calls to strlen() after ocfs2_sprintf_system_inode_name() kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths sched/task.h: fix the wrong comment on task_lock() nesting with tasklist_lock coccinelle: platform_no_drv_owner: handle also built-in drivers coccinelle: of_table: handle SPI device ID tables lib/decompress: use designated initializers for struct compress_format efi: support booting with kexec handover (KHO) ...
2 parents 8804d97 + 9f1c14c commit e406d57

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1619
-476
lines changed

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ Shuah Khan <[email protected]> <[email protected]>
721721
722722
723723
724-
724+
725+
725726
726727
727728

Documentation/accounting/delay-accounting.rst

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -134,47 +134,72 @@ The above command can be used with -v to get more debug information.
134134

135135
After the system starts, use `delaytop` to get the system-wide delay information,
136136
which includes system-wide PSI information and Top-N high-latency tasks.
137+
Note: PSI support requires `CONFIG_PSI=y` and `psi=1` for full functionality.
137138

138-
`delaytop` supports sorting by CPU latency in descending order by default,
139-
displays the top 20 high-latency tasks by default, and refreshes the latency
140-
data every 2 seconds by default.
139+
`delaytop` is an interactive tool for monitoring system pressure and task delays.
140+
It supports multiple sorting options, display modes, and real-time keyboard controls.
141141

142-
Get PSI information and Top-N tasks delay, since system boot::
142+
Basic usage with default settings (sorts by CPU delay, shows top 20 tasks, refreshes every 2 seconds)::
143143

144144
bash# ./delaytop
145-
System Pressure Information: (avg10/avg60/avg300/total)
146-
CPU some: 0.0%/ 0.0%/ 0.0%/ 345(ms)
145+
System Pressure Information: (avg10/avg60vg300/total)
146+
CPU some: 0.0%/ 0.0%/ 0.0%/ 106137(ms)
147147
CPU full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
148148
Memory full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
149149
Memory some: 0.0%/ 0.0%/ 0.0%/ 0(ms)
150-
IO full: 0.0%/ 0.0%/ 0.0%/ 65(ms)
151-
IO some: 0.0%/ 0.0%/ 0.0%/ 79(ms)
150+
IO full: 0.0%/ 0.0%/ 0.0%/ 2240(ms)
151+
IO some: 0.0%/ 0.0%/ 0.0%/ 2783(ms)
152152
IRQ full: 0.0%/ 0.0%/ 0.0%/ 0(ms)
153-
Top 20 processes (sorted by CPU delay):
154-
PID TGID COMMAND CPU(ms) IO(ms) SWAP(ms) RCL(ms) THR(ms) CMP(ms) WP(ms) IRQ(ms)
155-
----------------------------------------------------------------------------------------------
156-
161 161 zombie_memcg_re 1.40 0.00 0.00 0.00 0.00 0.00 0.00 0.00
157-
130 130 blkcg_punt_bio 1.37 0.00 0.00 0.00 0.00 0.00 0.00 0.00
158-
444 444 scsi_tmf_0 0.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00
159-
1280 1280 rsyslogd 0.53 0.04 0.00 0.00 0.00 0.00 0.00 0.00
160-
12 12 ksoftirqd/0 0.47 0.00 0.00 0.00 0.00 0.00 0.00 0.00
161-
1277 1277 nbd-server 0.44 0.00 0.00 0.00 0.00 0.00 0.00 0.00
162-
308 308 kworker/2:2-sys 0.41 0.00 0.00 0.00 0.00 0.00 0.00 0.00
163-
55 55 netns 0.36 0.00 0.00 0.00 0.00 0.00 0.00 0.00
164-
1187 1187 acpid 0.31 0.03 0.00 0.00 0.00 0.00 0.00 0.00
165-
6184 6184 kworker/1:2-sys 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
166-
186 186 kaluad 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
167-
18 18 ksoftirqd/1 0.24 0.00 0.00 0.00 0.00 0.00 0.00 0.00
168-
185 185 kmpath_rdacd 0.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00
169-
190 190 kstrp 0.23 0.00 0.00 0.00 0.00 0.00 0.00 0.00
170-
2759 2759 agetty 0.20 0.03 0.00 0.00 0.00 0.00 0.00 0.00
171-
1190 1190 kworker/0:3-sys 0.19 0.00 0.00 0.00 0.00 0.00 0.00 0.00
172-
1272 1272 sshd 0.15 0.04 0.00 0.00 0.00 0.00 0.00 0.00
173-
1156 1156 license 0.15 0.11 0.00 0.00 0.00 0.00 0.00 0.00
174-
134 134 md 0.13 0.00 0.00 0.00 0.00 0.00 0.00 0.00
175-
6142 6142 kworker/3:2-xfs 0.13 0.00 0.00 0.00 0.00 0.00 0.00 0.00
176-
177-
Dynamic interactive interface of delaytop::
153+
[o]sort [M]memverbose [q]quit
154+
Top 20 processes (sorted by cpu delay):
155+
PID TGID COMMAND CPU(ms) IO(ms) IRQ(ms) MEM(ms)
156+
------------------------------------------------------------------------
157+
110 110 kworker/15:0H-s 27.91 0.00 0.00 0.00
158+
57 57 cpuhp/7 3.18 0.00 0.00 0.00
159+
99 99 cpuhp/14 2.97 0.00 0.00 0.00
160+
51 51 cpuhp/6 0.90 0.00 0.00 0.00
161+
44 44 kworker/4:0H-sy 0.80 0.00 0.00 0.00
162+
60 60 ksoftirqd/7 0.74 0.00 0.00 0.00
163+
76 76 idle_inject/10 0.31 0.00 0.00 0.00
164+
100 100 idle_inject/14 0.30 0.00 0.00 0.00
165+
1309 1309 systemsettings 0.29 0.00 0.00 0.00
166+
45 45 cpuhp/5 0.22 0.00 0.00 0.00
167+
63 63 cpuhp/8 0.20 0.00 0.00 0.00
168+
87 87 cpuhp/12 0.18 0.00 0.00 0.00
169+
93 93 cpuhp/13 0.17 0.00 0.00 0.00
170+
1265 1265 acpid 0.17 0.00 0.00 0.00
171+
1552 1552 sshd 0.17 0.00 0.00 0.00
172+
2584 2584 sddm-helper 0.16 0.00 0.00 0.00
173+
1284 1284 rtkit-daemon 0.15 0.00 0.00 0.00
174+
1326 1326 nde-netfilter 0.14 0.00 0.00 0.00
175+
27 27 cpuhp/2 0.13 0.00 0.00 0.00
176+
631 631 kworker/11:2-rc 0.11 0.00 0.00 0.00
177+
178+
Interactive keyboard controls during runtime::
179+
180+
o - Select sort field (CPU, IO, IRQ, Memory, etc.)
181+
M - Toggle display mode (Default/Memory Verbose)
182+
q - Quit
183+
184+
Available sort fields(use -s/--sort or interactive command)::
185+
186+
cpu(c) - CPU delay
187+
blkio(i) - I/O delay
188+
irq(q) - IRQ delay
189+
mem(m) - Total memory delay
190+
swapin(s) - Swapin delay (memory verbose mode only)
191+
freepages(r) - Freepages reclaim delay (memory verbose mode only)
192+
thrashing(t) - Thrashing delay (memory verbose mode only)
193+
compact(p) - Compaction delay (memory verbose mode only)
194+
wpcopy(w) - Write page copy delay (memory verbose mode only)
195+
196+
Advanced usage examples::
197+
198+
# ./delaytop -s blkio
199+
Sorted by IO delay
200+
201+
# ./delaytop -s mem -M
202+
Sorted by memory delay in memory verbose mode
178203

179204
# ./delaytop -p pid
180205
Print delayacct stats

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4603,7 +4603,7 @@
46034603
bit 2: print timer info
46044604
bit 3: print locks info if CONFIG_LOCKDEP is on
46054605
bit 4: print ftrace buffer
4606-
bit 5: replay all messages on consoles at the end of panic
4606+
bit 5: replay all kernel messages on consoles at the end of panic
46074607
bit 6: print all CPUs backtrace (if available in the arch)
46084608
bit 7: print only tasks in uninterruptible (blocked) state
46094609
*Be aware* that this option may print a _lot_ of lines,

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ bit 1 print system memory info
890890
bit 2 print timer info
891891
bit 3 print locks info if ``CONFIG_LOCKDEP`` is on
892892
bit 4 print ftrace buffer
893-
bit 5 replay all messages on consoles at the end of panic
893+
bit 5 replay all kernel messages on consoles at the end of panic
894894
bit 6 print all CPUs backtrace (if available in the arch)
895895
bit 7 print only tasks in uninterruptible (blocked) state
896896
===== ============================================

Documentation/dev-tools/kcov.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,12 @@ local tasks spawned by the process and the global task that handles USB bus #1:
361361
*/
362362
sleep(2);
363363
364-
n = __atomic_load_n(&cover[0], __ATOMIC_RELAXED);
364+
/*
365+
* The load to the coverage count should be an acquire to pair with
366+
* pair with the corresponding write memory barrier (smp_wmb()) on
367+
* the kernel-side in kcov_move_area().
368+
*/
369+
n = __atomic_load_n(&cover[0], __ATOMIC_ACQUIRE);
365370
for (i = 0; i < n; i++)
366371
printf("0x%lx\n", cover[i + 1]);
367372
if (ioctl(fd, KCOV_DISABLE, 0))

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20987,7 +20987,7 @@ F: Documentation/devicetree/bindings/power/avs/qcom,cpr.yaml
2098720987
F: drivers/pmdomain/qcom/cpr.c
2098820988

2098920989
QUALCOMM CPUCP MAILBOX DRIVER
20990-
M: Sibi Sankar <quic_sibis@quicinc.com>
20990+
M: Sibi Sankar <[email protected].com>
2099120991
2099220992
S: Supported
2099320993
F: Documentation/devicetree/bindings/mailbox/qcom,cpucp-mbox.yaml

arch/x86/kernel/crash.c

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,23 @@ static struct crash_mem *fill_up_crash_elf_data(void)
165165
/*
166166
* Exclusion of crash region, crashk_low_res and/or crashk_cma_ranges
167167
* may cause range splits. So add extra slots here.
168+
*
169+
* Exclusion of low 1M may not cause another range split, because the
170+
* range of exclude is [0, 1M] and the condition for splitting a new
171+
* region is that the start, end parameters are both in a certain
172+
* existing region in cmem and cannot be equal to existing region's
173+
* start or end. Obviously, the start of [0, 1M] cannot meet this
174+
* condition.
175+
*
176+
* But in order to lest the low 1M could be changed in the future,
177+
* (e.g. [start, 1M]), add a extra slot.
168178
*/
169-
nr_ranges += 2 + crashk_cma_cnt;
179+
nr_ranges += 3 + crashk_cma_cnt;
170180
cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
171181
if (!cmem)
172182
return NULL;
173183

174184
cmem->max_nr_ranges = nr_ranges;
175-
cmem->nr_ranges = 0;
176185

177186
return cmem;
178187
}
@@ -323,16 +332,20 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
323332
struct crash_mem *cmem;
324333

325334
/*
326-
* Using random kexec_buf for passing dm crypt keys may cause a range
327-
* split. So use two slots here.
335+
* In the current x86 architecture code, the elfheader is always
336+
* allocated at crashk_res.start. But it depends on the allocation
337+
* position of elfheader in crashk_res. To avoid potential out of
338+
* bounds in future, add an extra slot.
339+
*
340+
* And using random kexec_buf for passing dm crypt keys may cause a
341+
* range split too, add another extra slot here.
328342
*/
329-
nr_ranges = 2;
343+
nr_ranges = 3;
330344
cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
331345
if (!cmem)
332346
return -ENOMEM;
333347

334348
cmem->max_nr_ranges = nr_ranges;
335-
cmem->nr_ranges = 0;
336349

337350
memset(&cmd, 0, sizeof(struct crash_memmap_data));
338351
cmd.params = params;

arch/x86/kernel/kexec-bzimage64.c

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/kexec.h>
1717
#include <linux/kernel.h>
1818
#include <linux/mm.h>
19+
#include <linux/libfdt.h>
20+
#include <linux/of_fdt.h>
1921
#include <linux/efi.h>
2022
#include <linux/random.h>
2123

@@ -212,6 +214,28 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
212214
}
213215
#endif /* CONFIG_EFI */
214216

217+
#ifdef CONFIG_OF_FLATTREE
218+
static void setup_dtb(struct boot_params *params,
219+
unsigned long params_load_addr,
220+
unsigned int dtb_setup_data_offset)
221+
{
222+
struct setup_data *sd = (void *)params + dtb_setup_data_offset;
223+
unsigned long setup_data_phys, dtb_len;
224+
225+
dtb_len = fdt_totalsize(initial_boot_params);
226+
sd->type = SETUP_DTB;
227+
sd->len = dtb_len;
228+
229+
/* Carry over current boot DTB with setup_data */
230+
memcpy(sd->data, initial_boot_params, dtb_len);
231+
232+
/* Add setup data */
233+
setup_data_phys = params_load_addr + dtb_setup_data_offset;
234+
sd->next = params->hdr.setup_data;
235+
params->hdr.setup_data = setup_data_phys;
236+
}
237+
#endif /* CONFIG_OF_FLATTREE */
238+
215239
static void
216240
setup_ima_state(const struct kimage *image, struct boot_params *params,
217241
unsigned long params_load_addr,
@@ -336,6 +360,17 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,
336360
sizeof(struct efi_setup_data);
337361
#endif
338362

363+
#ifdef CONFIG_OF_FLATTREE
364+
if (image->force_dtb && initial_boot_params) {
365+
setup_dtb(params, params_load_addr, setup_data_offset);
366+
setup_data_offset += sizeof(struct setup_data) +
367+
fdt_totalsize(initial_boot_params);
368+
} else {
369+
pr_debug("Not carrying over DTB, force_dtb = %d\n",
370+
image->force_dtb);
371+
}
372+
#endif
373+
339374
if (IS_ENABLED(CONFIG_IMA_KEXEC)) {
340375
/* Setup IMA log buffer state */
341376
setup_ima_state(image, params, params_load_addr,
@@ -529,6 +564,12 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
529564
sizeof(struct setup_data) +
530565
RNG_SEED_LENGTH;
531566

567+
#ifdef CONFIG_OF_FLATTREE
568+
if (image->force_dtb && initial_boot_params)
569+
kbuf.bufsz += sizeof(struct setup_data) +
570+
fdt_totalsize(initial_boot_params);
571+
#endif
572+
532573
if (IS_ENABLED(CONFIG_IMA_KEXEC))
533574
kbuf.bufsz += sizeof(struct setup_data) +
534575
sizeof(struct ima_setup_data);
@@ -537,7 +578,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
537578
kbuf.bufsz += sizeof(struct setup_data) +
538579
sizeof(struct kho_data);
539580

540-
params = kzalloc(kbuf.bufsz, GFP_KERNEL);
581+
params = kvzalloc(kbuf.bufsz, GFP_KERNEL);
541582
if (!params)
542583
return ERR_PTR(-ENOMEM);
543584
efi_map_offset = params_cmdline_sz;
@@ -647,7 +688,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
647688
return ldata;
648689

649690
out_free_params:
650-
kfree(params);
691+
kvfree(params);
651692
return ERR_PTR(ret);
652693
}
653694

@@ -659,7 +700,7 @@ static int bzImage64_cleanup(void *loader_data)
659700
if (!ldata)
660701
return 0;
661702

662-
kfree(ldata->bootparams_buf);
703+
kvfree(ldata->bootparams_buf);
663704
ldata->bootparams_buf = NULL;
664705

665706
return 0;

drivers/firmware/efi/efi-init.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/efi.h>
1313
#include <linux/fwnode.h>
1414
#include <linux/init.h>
15+
#include <linux/kexec_handover.h>
1516
#include <linux/memblock.h>
1617
#include <linux/mm_types.h>
1718
#include <linux/of.h>
@@ -164,12 +165,32 @@ static __init void reserve_regions(void)
164165
pr_info("Processing EFI memory map:\n");
165166

166167
/*
167-
* Discard memblocks discovered so far: if there are any at this
168-
* point, they originate from memory nodes in the DT, and UEFI
169-
* uses its own memory map instead.
168+
* Discard memblocks discovered so far except for KHO scratch
169+
* regions. Most memblocks at this point originate from memory nodes
170+
* in the DT and UEFI uses its own memory map instead. However, if
171+
* KHO is enabled, scratch regions, which are good known memory
172+
* must be preserved.
170173
*/
171174
memblock_dump_all();
172-
memblock_remove(0, PHYS_ADDR_MAX);
175+
176+
if (is_kho_boot()) {
177+
struct memblock_region *r;
178+
179+
/* Remove all non-KHO regions */
180+
for_each_mem_region(r) {
181+
if (!memblock_is_kho_scratch(r)) {
182+
memblock_remove(r->base, r->size);
183+
r--;
184+
}
185+
}
186+
} else {
187+
/*
188+
* KHO is disabled. Discard memblocks discovered so far:
189+
* if there are any at this point, they originate from memory
190+
* nodes in the DT, and UEFI uses its own memory map instead.
191+
*/
192+
memblock_remove(0, PHYS_ADDR_MAX);
193+
}
173194

174195
for_each_efi_memory_desc(md) {
175196
paddr = md->phys_addr;

drivers/video/fbdev/core/fbcon.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,7 @@ static int fbcon_get_rotate(struct fb_info *info)
279279

280280
static bool fbcon_skip_panic(struct fb_info *info)
281281
{
282-
/* panic_cpu is not exported, and can't be used if built as module. Use
283-
* oops_in_progress instead, but non-fatal oops won't be printed.
284-
*/
285-
#if defined(MODULE)
286-
return (info->skip_panic && unlikely(oops_in_progress));
287-
#else
288-
return (info->skip_panic && unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID));
289-
#endif
282+
return (info->skip_panic && unlikely(panic_in_progress()));
290283
}
291284

292285
static inline bool fbcon_is_active(struct vc_data *vc, struct fb_info *info)

0 commit comments

Comments
 (0)