What is the concept of vruntime in CFS

后端 未结 2 597
误落风尘
误落风尘 2020-12-14 03:39

I have been reading about Linux Kernel and CFS scheduler in the kernel. I came across vruntime (virtual runtime) that is the core concept behind CFS scheduler. I re

2条回答
  •  执念已碎
    2020-12-14 04:11

    The vruntime is the virtual runtime of a process which helps in tracking for how much time a process has run. The vruntime is a member of the sched_entity structure defined in include/linux/sched.h

    The min_vruntime represents the minimum vruntime of a cfs runqueue. It represents the minimum of all the vruntime of the processes that is scheduled on that cfs runqueue. The min_vruntime is a member of cfs_rq structure defined in include/linux/sched.h

    The purpose of min_vruntime is to select the next process in the cfs runqueue to run. In order to be fair to all the processes, the CFS scheduler selects the process with the minimum vruntime to execute first.

    The link to include/linux/sched.h is http://lxr.free-electrons.com/source/include/linux/sched.h

提交回复
热议问题