sched-ext / scx

sched_ext schedulers and tools
https://bit.ly/scx_slack
GNU General Public License v2.0
982 stars 95 forks source link

__handle_mm_fault can not be (reliably) kprobe'd #823

Closed pg83 closed 1 month ago

pg83 commented 1 month ago

It is declared as static, https://elixir.bootlin.com/linux/v6.11.4/source/mm/memory.c#L5586, and actually inlined in my kernel build:

pg# cat /proc/kallsyms | grep handle_mm_fault
0000000000000000 T handle_mm_fault # no __handle_mm_fault!

So scx_rustland can not start:

....
libbpf: map '.data.BPFLAND': created successfully, fd=15
libbpf: map 'rustland': created successfully, fd=16
libbpf: prog 'kprobe_handle_mm_fault': failed to create kprobe '__handle_mm_fault+0x0' perf event: No such file or directory
libbpf: prog 'kprobe_handle_mm_fault': failed to auto-attach: -2
Error: Failed to attach non-struct_ops BPF programs

Caused by:
    No such file or directory (os error 2)
pg83 commented 1 month ago

I see that was fixed in HEAD, so I tried build it from https://github.com/sched-ext/scx/archive/fb3f1d0b43d8a1f69cbc434f4a43145dbd983076.zip

It builds, but froze my system after short period of working, without any clue.

pg83 commented 1 month ago

I am on 6.12-rc3, by the way.

arighi commented 1 month ago

With the 6.12 kernel you need this additional kernel patch to run rustland reliably: https://github.com/arighi/sched_ext/commit/3ff4a76b38356395adaf26141c64ca94f0bf166f

This reverts an old task switching behavior that is required by rustland and it changed in 6.12.

arighi commented 1 month ago

This issue should be fixed by b3c5a23693cb697addbeabc31bcde2c36845f0b0, so I'm closing this for now.