What is the vruntime of one process after it is moved into another run queue in Linux Kernel

When we do migration, one process will be migrated from one source CPU's runqueue to destination CPU's run queue. What is the virtual run time (if CFS is used) after it is moved into destination CPU's run queue?

asked Jan 10 by harryxiyou (4,840 points)

1 Answer

 
Best answer

When the process is dequeued from source CPU's run queue, its vruntime will minus the minimum vruntime of source CPU's run queue.

When the process is enqueued destination CPU's run queue, its vruntime will plus the minimum vruntime of destination CPU's run queue.

    enqueue_entity (...) {
    ...
    se->vruntime += cfs_rq->min_vruntime;
    ...
    }
    
    dequeue_entity(...) {
    ...
    se->vruntime -= cfs_rq->min_vruntime;
    ...
    }
answered Jan 10 by harryxiyou (4,840 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...