Configuration parameters of the scheduler
/proc/sys/kernel/sched_min_granularity_ns (4000000ns):
Sysctl_sched_min_granularity, which represents the minimum process run time , prevents frequent switching, and for interactive systems such as desktops, this value can be set to a smaller size, which guarantees a faster response to the interaction (see Cycle Scheduler Check_ Preempt_tick process)
/proc/sys/kernel/sched_latency_ns (20000000ns):
Sysctl_Sched_latency, which represents a cycle in which all processes running a queue run once , the current number of processes running the queue, and if the number of processes exceeds sched_nr_latency (this variable cannot be set by/proc, it is by ( sysctl_sched_latency+ sysctl_sched_min_granularity-1)/sysctl_sched_min_granularity determined), then the dispatch cycle is Sched_min_ granularity_ns* the number of processes in the run queue, regardless of sysctl_sched_latency, otherwise the number of queue processes is less than sched_nr_latency, and the run cycle is sysctl_sched_latency. Obviously, the smaller the number, the less sched_nr_latency a running queue supports, and the more sched_nr_latency sysctl_sched_min_granularity can support in an hour, The less time each process can execute in this cycle, which is also consistent with the discussion of the sysctl_sched_min_granularity variable above. In fact, sched_nr_latency can also be used as our CPU load reference value, if the CPU load is greater than this value, then the CPU is not enough to use
/proc/sys/kernel/sched_features (3183D=110001101111B):
Sysctl_Sched_features, which represents the features supported by the scheduler , such as gentle_fair_sleepers (smoothing the compensating sleep process), start_debit (the new process is scheduled as early as possible), Wakeup_ PREEMPT (whether the wakeup process can preempt the currently running process), etc., all features see the definition of the kernel sech_features.h file
/proc/sys/kernel/sched_wakeup_granularity_ns (4000000ns):
Sysctl_Sched_wakeup_granularity, which represents the cardinality of the time at which a process should run at least after waking , is used to determine whether a process should preempt the current process and does not represent the minimum time it can perform (sysctl_ sched_min_granularity), if the number is smaller, then the probability of preemption is higher (see Wakeup_gran, wakeup_preempt_entity function)
/proc/sys/kernel/sched_child_runs_first (0):
Sysctl_Sched_child_runs_first, which indicates whether the child process is preempted by the parent process when the child process is created , even if the parent process's vruntime is smaller than the child process, this reduces fairness but can reduce the Write_on_ Copy, depending on the application of the system to consider which method to use (see Task_fork_fair process)
/proc/sys/kernel/sched_cfs_bandwidth_slice_us (5000US):
Sysctl_sched_cfs_bandwidth_slice
/proc/sys/kernel/sched_rt_period_us (1000000US):
Sysctl_Sched_rt_period, this parameter together with the following sysctl_sched_rt_runtime determines the real-time process in the sysctl_sched_rt_period cycle of time, The total time that a real-time process can run cannot exceed Sysctl_sched_rt_runtime (code see SCHED_RT_GLOBAL_CONSTRAINTS)
/proc/sys/kernel/sched_rt_runtime_us (950000US):
Sysctl_sched_rt_runtime, see the explanation of the sysctl_sched_rt_period variable
/proc/sys/kernel/sched_compat_yield (0):
Sysctl_sched_compat_yield, this parameter allows the Sched_yield () system call to be more efficient, allowing it to use fewer CPUs, and for applications that rely on Sched_yield for better performance, consider setting it to 1
/proc/sys/kernel/sched_migration_cost (500000ns):
Sysctl_sched_migration_cost the variable is used to determine if a process is still hot, and if the run time of the process (Now-p->se.exec_start) is less than it, then the kernel thinks its code is still in the cache, So the process is hot, so you don't think about it when you're migrating.
/proc/sys/kernel/sched_nr_migrate (32):
Sysctl_sched_nr_migrate, how many processes are moved to another CPU at a time when load balancing is in multi-CPU situations
/proc/sys/kernel/sched_tunable_scaling (1):
Sysctl_sched_tunable_scaling, when the kernel tries to adjust sched_min_granularity,sched_latency and sched_wakeup_ Granularity the three value of the use of the Update method, 0 is not adjusted, 1 is based on the number of CPUs to 2 base on the value of the adjustment, 2 for the number of CPUs to adjust linearly proportional
Configuration parameters of the Linux scheduler ZZ