스케줄 링 관련 데이터 구조
스케줄 링 하면 첫 번 째 는 taskstruct 는 프로 세 스 / 스 레 드 를 표시 하 는 데 사 용 됩 니 다. 스케줄 링 의 실체 단위 로 볼 수 있 습 니 다. 이 구조 체 에서 스케줄 링 과 비교적 밀접 한 구성원 은 다음 과 같 습 니 다.
struct task_struct {
int prio, static_prio, normal_prio;
unsigned int rt_priority;
const struct sched_class *sched_class;
struct sched_entity se;
struct sched_rt_entity rt;
#ifdef CONFIG_CGROUP_SCHED
struct task_group *sched_task_group;
#endif
struct sched_dl_entity dl;
...
unsigned int policy;
int nr_cpus_allowed;
cpumask_t cpus_allowed;
}
prio 와 normalprio 는 동적 우선 순위, staticprio 는 정적 우선 순위 입 니 다. 정적 우선 순 위 는 시작 할 때 정적 으로 분 배 됩 니 다. 예 를 들 어 nice 값 이나 sched 를 사용 합 니 다.setscheduler () 시스템 호출.normal_prio 는 정적 우선 순위 와 스케줄 링 전략 을 바탕 으로 계산 합 니 다. prio 는 특정한 상황 에서 커 널 이 프로 세 스 의 우선 순 위 를 잠시 높 여야 합 니 다
2. sched_class
3. sched_entity
struct sched_entity {
struct load_weight load;
struct rb_node run_node;
unsigned int on_rq;
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
u64 prev_sum_exec_runtime;
}
4. 567917. load 는 부하 균형 에 사용 되 고 가중치 를 지정 하 며 이 값 을 계산 하 는 것 이 스케줄 러 의 중임 입 니 다