调度器40—sched_features
基于 Linux-5.10
一、实验
1. kernel/sched/debug.c 中将以debugfs文件导出的 sched_feat_fops 文件改为procfs导出。
static const struct proc_ops sched_feat_proc_fops = { .proc_open = sched_feat_open, .proc_write = sched_feat_write, .proc_read = seq_read, .proc_lseek = seq_lseek, .proc_release = single_release, }; proc_create("sched_features", 0644, NULL, &sched_feat_proc_fops);
备注:5.15内核上这个文件已经默认导出来了,# cat /sys/kernel/debug/sched/features。
2. enable/disable具体feature
# cat /proc/sched_features GENTLE_FAIR_SLEEPERS START_DEBIT NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY WAKEUP_PREEMPTION NO_HRTICK NO_DOUBLE_TICK NONTASK_CAPACITY NO_TTWU_QUEUE NO_SIS_AVG_CPU SIS_PROP NO_WARN_DOUBLE_CLOCK RT_PUSH_IPI NO_RT_RUNTIME_SHARE NO_LB_MIN ATTACH_AGE_LOAD WA_IDLE WA_WEIGHT WA_BIAS UTIL_EST UTIL_EST_FASTUP ALT_PERIOD BASE_SLICE # echo NO_UTIL_EST > /proc/sched_features # echo LB_MIN > /proc/sched_features # cat /proc/sched_features GENTLE_FAIR_SLEEPERS START_DEBIT NO_NEXT_BUDDY LAST_BUDDY CACHE_HOT_BUDDY WAKEUP_PREEMPTION NO_HRTICK NO_DOUBLE_TICK NONTASK_CAPACITY NO_TTWU_QUEUE NO_SIS_AVG_CPU SIS_PROP NO_WARN_DOUBLE_CLOCK RT_PUSH_IPI NO_RT_RUNTIME_SHARE LB_MIN ATTACH_AGE_LOAD WA_IDLE WA_WEIGHT WA_BIAS NO_UTIL_EST UTIL_EST_FASTUP ALT_PERIOD BASE_SLICE
posted on 2022-10-02 20:51 Hello-World3 阅读(492) 评论(0) 编辑 收藏 举报