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?

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 by harryxiyou.

Weiwei Jia

Weiwei Jia is a Ph.D. student in the Department of Computer Science at New Jersey Institute of Technology since 2016. His research interests are include storage systems, operating systems and computer systems.

Leave a Reply

Your email address will not be published. Required fields are marked *