Description
runqlen / cpuunclaimed add check_runnable_weight_field()
as workaround to check runnable_weight
presents in struct cfs_rq
in kernel/sched/sched.h by trying to access
runnable_weightfield of
struct sched_entityin
include/linux/sched.h`. Please check more details in PR #1510 and #2164.
Unfortunately, the runnable_weight
field of struct cfs_rq
is removed, but the runnable_weight
field of struct sched_entity
is remiand by following patchset series from Linux version 5.7.0.
- https://yhbt.net/lore/all/20200214152729.6059-4-vincent.guittot@linaro.org/
- https://yhbt.net/lore/all/20200214152729.6059-5-vincent.guittot@linaro.org/
Please also check the source of Linux below.
- include/linux/sched.h
- kernel/sched/sched.h
I can fix it with following workaround and verified on Linux 5.10.70, but it seems this is not properly solution for creating PR.
123 // Declare enough of cfs_rq to find nr_running, since we can't #import the
124 // header. This will need maintenance. It is from kernel/sched/sched.h:
125 struct cfs_rq_partial {
126 struct load_weight load;
+ 127 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0)
128 RUNNABLE_WEIGHT_FIELD
+ 129 #endif
130 unsigned int nr_running, h_nr_running;
131 };
Hi @yonghong-song,
I am willing to create PR to fix this issue, could you please help to give me some advice how to fix this in properly way? Thank you. :)
Activity
yonghong-song commentedon May 6, 2023
@ismhong Thanks for the reporting. I think we could fix in the following way:
I think most of recent kernels should already have BTF enabled. Not sure about 5.7 kernel or not, could you double check?
Hopefully in the distant future, BTF is available for all kernels, and we can remove step 2.
Please also fix cpuunclaimed.py which has similar problem to runqlen.py.
runqlen/cpuunclaimed: Fix runnable_weight issue after Linux 5.7
runqlen/cpuunclaimed: Fix runnable_weight issue after Linux 5.7
ismhong commentedon May 8, 2023
@yonghong-song
I have created a PR #4606 to fix this issue, but I am not sure why it didn't pass smoke test below.
https://github.com/iovisor/bcc/actions/runs/4912388699/jobs/8771353011?pr=4606#step:10:1432
It seems this failure isn't caused by my changes. Could you please give me some advice to fix it? Thank you. :)
runqlen/cpuunclaimed: Fix runnable_weight issue after Linux 5.7
runqlen/cpuunclaimed: Fix runnable_weight issue after Linux 5.7
ismhong commentedon May 19, 2023
Fixed by PR #4606.
Close this ticket.
runqlen/cpuunclaimed: Fix runnable_weight issue after Linux 5.7