Linux kernel CFS调度程序:如何知道将哪个任务分配给sched_实体?
我在sched_fair.c里面,我想记录一些事情。。但是我需要知道哪个任务(pid)与我看到的每个sched_实体相关联。。在struct sched_entity的定义中,我没有看到对父结构(task_struct)的任何引用 这是sched_实体的代码:Linux kernel CFS调度程序:如何知道将哪个任务分配给sched_实体?,linux-kernel,scheduling,kernel,Linux Kernel,Scheduling,Kernel,我在sched_fair.c里面,我想记录一些事情。。但是我需要知道哪个任务(pid)与我看到的每个sched_实体相关联。。在struct sched_entity的定义中,我没有看到对父结构(task_struct)的任何引用 这是sched_实体的代码: struct sched_entity { struct load_weight load; /* for load-balancing */ struct rb_node run_node;
struct sched_entity {
struct load_weight load; /* for load-balancing */
struct rb_node run_node;
struct list_head group_node;
unsigned int on_rq;
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
u64 prev_sum_exec_runtime;
u64 nr_migrations;
#ifdef CONFIG_SCHEDSTATS
struct sched_statistics statistics;
#endif
#ifdef CONFIG_FAIR_GROUP_SCHED
struct sched_entity *parent;
/* rq on which this entity is (to be) queued: */
struct cfs_rq *cfs_rq;
/* rq "owned" by this entity/group: */
struct cfs_rq *my_q;
#endif
};
给定
sched_实体*se:
struct task_struct*p=任务(se)
为您提供包含任务的结构。给定
sched_实体*se:
struct task_struct*p=任务(se)
为您提供包含任务的结构