Re: [RFC 06/10] Reclaim memory from blocked kernel stacks

From: Steven Rostedt

Date: Fri Aug 28 2026 - 15:17:21 EST


On Fri, 28 Aug 2026 15:13:13 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> If one worries about stack size, they may want to turn off
> CONFIG_RANDOMIZE_KSTACK_OFFSET as I see some big numbers for do_syscall_64()

And the scheduler has some heavy stack usage here!

# trace-cmd stack
(stack tracer running)
Depth Size Location (31 entries)
----- ---- --------
0) 8120 48 __msecs_to_jiffies+0x9/0x30
1) 8072 104 update_group_capacity+0x94/0x960
2) 7968 528 update_sd_lb_stats.constprop.0+0x426/0x39b0
3) 7440 424 sched_balance_find_src_group+0x8f/0x1150
4) 7016 552 sched_balance_rq+0x934/0x4130
5) 6464 408 pick_task_fair+0xa71/0x1fe0
6) 6056 496 __schedule+0x628/0x76f0
7) 5560 32 schedule+0xde/0x2c0
8) 5528 32 io_schedule+0x8c/0x100
9) 5496 256 rq_qos_wait+0x12b/0x230
10) 5240 136 wbt_wait+0x150/0x260
11) 5104 40 __rq_qos_throttle+0x51/0xa0
12) 5064 304 blk_mq_submit_bio+0xc40/0x28e0
13) 4760 240 submit_bio_noacct_nocheck+0x410/0xb30
14) 4520 40 ext4_io_submit+0xca/0x1a0
15) 4480 144 ext4_bio_write_folio+0x5e2/0x1470
16) 4336 96 mpage_process_page_bufs+0x392/0x700
17) 4240 616 mpage_prepare_extent_to_map+0xaae/0x1120
18) 3624 480 ext4_do_writepages+0x971/0x37f0
19) 3144 312 ext4_writepages+0x2d2/0x610
20) 2832 152 do_writepages+0x21e/0x560
21) 2680 184 __writeback_single_inode+0x119/0x1240
22) 2496 752 writeback_sb_inodes+0x67d/0x17b0
23) 1744 168 __writeback_inodes_wb+0xf2/0x270
24) 1576 304 wb_writeback+0x63e/0x890
25) 1272 320 wb_workfn+0x844/0xca0
26) 952 360 process_one_work+0x8b4/0x15d0
27) 592 176 worker_thread+0x5d3/0xfb0
28) 416 64 kthread+0x33c/0x420
29) 352 160 ret_from_fork+0x65c/0x9e0
30) 192 192 ret_from_fork_asm+0x1a/0x30

Note, I'm running this on my server. That is, this is a production machine.

-- Steve