基于 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);
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
标签:sched,BUDDY,WA,NO,40,proc,features From: https://www.cnblogs.com/hellokitty2/p/16749435.html