Reputation: 320
In Linux when a new process is created, it inherits the normal_prio
value of it's parent process for it's static_prio
. Where does this actually happen??
Is it done in dup_task_struct()
function or in copy_process()
function??
Upvotes: 1
Views: 786
Reputation: 28535
It actually happens in sched_fork which is called by copy_process
The parent's priority is transferred into the child initially something like this
p->prio = current->normal_prio;
where p is child's task_struct
and current
points to parent.
And then normal_prio
is modified like this
p->prio = p->normal_prio = __normal_prio(p);
__normal_prio(p)
finally boils down to something like
return p->static_prio;
Check out the 2 links I've added to explore more.
Upvotes: 1