Skip to content

Commit

Permalink
anolis: sched: Credit clarification for BVT and its related work
Browse files Browse the repository at this point in the history
ANBZ: torvalds#781

Group Identity is a totally different feature from BVT, and the
defination and logic of bvt_warp_ns has been totally reformed.

While 10 lines of code are related to BVT paper and it's code
(Jacob Leverich), this patch gives credit to BVT and its related
work.

Signed-off-by: Cruz Zhao <CruzZhao@linux.alibaba.com>
Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
Signed-off-by: Shanpei Chen <shanpeic@linux.alibaba.com>
Acked-by: Michael Wang <yun.wang@linux.alibaba.com>
  • Loading branch information
Cruz Zhao authored and Cruz Zhao committed Apr 2, 2022
1 parent 144056c commit 7093d75
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
25 changes: 24 additions & 1 deletion kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -7087,7 +7087,30 @@ static struct cftype cpu_legacy_files[] = {
},
#endif
#ifdef CONFIG_GROUP_IDENTITY
/* legacy bvt interface */
/* legacy bvt interface
*
* BVT(Borrowed Virtual Time) is derived from paper:
* "Borrowed-virtual-time (BVT) scheduling: supporting
* latency-sensitive threads in a general-purpose scheduler"
* Link: https://dl.acm.org/doi/abs/10.1145/319344.319169
*
* Jacob Leverich implemented the idea of this paper, and
* 'bvt_warp_ns' interface is derived from Leverich's code.
* Link: https://gist.github.com/leverich/5913713.
*
* Now we have reformed the whole idea, and only reserved
* the name of 'bvt_warp_ns' to be compalitible.
*
* 'bvt_warp_ns' will be converted into identity when written.
* The correspondence of bvt_warp_ns and identity follows:
* bvt identity value identity
* -2 9 ID_UNDERCLASS | ID_IDLE_SAVER
* -1 9 ID_UNDERCLASS | ID_IDLE_SAVER
* 0 0 ID_NORMAL
* 1 18 ID_HIGHCLASS | ID_IDLE_SEEKER
* 2 22 ID_HIGHCLASS | ID_IDLE_SEEKER | ID_SMT_EXPELLER
*
*/
{
.name = "bvt_warp_ns",
.read_s64 = cpu_bvt_warp_ns_read_s64,
Expand Down
8 changes: 8 additions & 0 deletions kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;

#ifdef CONFIG_GROUP_IDENTITY
/*
* Variable 'sysctl_sched_bvt_place_epsilon' is derived from
* https://gist.github.com/leverich/5913713.
* Author: Jacob Leverich
*
* Waking batch tasks are placed sched_bvt_place_epsilon
* nanoseconds relative to min_vruntime.
*
Expand Down Expand Up @@ -5290,6 +5294,10 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)

#ifdef CONFIG_GROUP_ENTITY
/*
* The logic of punishing underclass is derived from
* https://gist.github.com/leverich/5913713.
* Author: Jacob Leverich
*
* The runtime penalty for underclass wakee to make sure
* they won't interrupt other's execution too much.
*/
Expand Down
5 changes: 5 additions & 0 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@ static struct ctl_table kern_table[] = {
#endif
#ifdef CONFIG_GROUP_IDENTITY
{
/*
* Variable 'sysctl_sched_bvt_place_epsilon' is derived from
* https://gist.github.com/leverich/5913713.
* Author: Jacob Leverich
*/
.procname = "sched_bvt_place_epsilon",
.data = &sysctl_sched_bvt_place_epsilon,
.maxlen = sizeof(unsigned int),
Expand Down

0 comments on commit 7093d75

Please sign in to comment.