Thanks for your time and last weekend I raised a problem, but it maybe not so detail, So I want to detail my problem.
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 cache_miss_rate; // the new variable I insert
u64 nr_migrations;
.....
.....
}
for the new comming process I want to set the new variable as 1. Then after the process executed, I calculate the cache miss rate and I feed the data into the variable(update the variable), then use the data to modify some other parameter(e.g vruntime and slice) in the kernel. But I do not how to initialize the new variable(or whether I need to initialize the new variable) for the new comming process(I know that the child process would copy PCB from its parent process, but at the very beginning, the init process has to initialize the variable.)
Besides, I also have trouble in finding out how to feed data into the new variable from user level application.
Thanks a lot.
Best Regards.