<div dir="ltr"><span style="font-size:14px">Hi.</span><div style="font-size:14px">Thanks for your time and last weekend I raised a problem, but it maybe not so detail, So I want to detail my problem.</div><div style="font-size:14px"><br></div><div style="font-size:14px">M<span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">y problem is that I insert a new variable into </span><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">struct </span><a href="http://lxr.free-electrons.com/source/include/linux/ident?i=sched_entity" target="_blank" style="font-family:arial,helvetica,sans-serif;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153)">sched_entity</a><span style="color:rgb(0,0,0);font-family:arial,helvetica,sans-serif">, like that</span></div><div style="font-size:14px"><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><div>struct sched_entity {</div><div> struct load_weight load; /* for load-balancing */</div><div> struct rb_node run_node;</div><div> struct list_head group_node;</div><div> unsigned int on_rq;</div><div> </div><div> u64 exec_start;</div><div> u64 sum_exec_runtime;</div><div> u64 vruntime;</div><div> u64 prev_sum_exec_runtime;</div><div> <span style="background-color:rgb(255,0,0)"> u64<span style="white-space:pre-wrap">                 </span>cache_miss_rate; // the new variable I insert</span></div><div><br></div><div> u64 nr_migrations;</div><div>.....</div><div>.....</div><div> }</div></div><div>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.)</div><div>Besides, I also have trouble in finding out how to feed data into the new variable from user level application. </div></div><div style="font-size:14px"><br></div><div style="font-size:14px">Thanks a lot.</div><div style="font-size:14px">Best Regards.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-14 11:16 GMT+02:00 Youcun Liu <span dir="ltr"><<a href="mailto:liuyoucun1993@gmail.com" target="_blank">liuyoucun1993@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div><br></div><div>I am now working on building my own linux kernel and I want to add a new attribute into the process control block. Then I will feed some data to the new attribute from a user application. Finally I want to use the date to improve the some original kernel algorithm(e.g process schduling).</div><div><br></div><div>I tried to initialize the new attribute directly in the 'task_struct', obviously, it failed. So I decide to initialize the new attribute at the very beginning, but I do not know how. Besides, I have trouble in finding out which function can help me feed data to the new attribute.</div><div><br></div><div>Could you please give me some suggestions and help? Thanks a lot.</div><div><br></div><div>Best regards,</div><div>Youcun Liu</div></div>
</blockquote></div><br></div>