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

Posted on In QA

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;
    ...
    }

Leave a Reply

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