Re: [PATCH rfc 0/6] Scheduler BPF

From: Ren Zhijie
Date: Tue Jul 19 2022 - 09:54:05 EST


Hi Roman and list,

We want to implement a programmable scheduler to meet the schedule requirements of different workloads.

Using BPF, we can easily deploy schedule policies for specific workloads, quickly verifying without modifying the kernel code. This greatly reduces the cost of deploying new schedule policies in the production environment.

Therefore, we want to continue to develop based on your patch. We plan to merge it into the openeuler open-source community and use the community to continuously evolve and maintain it.
(link: https://www.openeuler.org/en/)

We made some changes to your patch:
1. Adapt to the openeuler-OLK-5.10 branch, which mostly base on linux longterm branch 5.10.
2. Introduce the Kconfig CONFIG_BPF_SCHED to isolate related code at compile time.
3. helpers bpf_sched_entity_to_cgrpid() and bpf_sched_entity_belongs_to_cgrp() are modified to obtain the task group to which the sched entity belongs through se->my_q->tg->css.cgroup.

We have some ideas for the next iteration of Scheduler BPF that we would like to share with you:
1.The tag field is added to struct task_struct and struct task_group. Users can use the file system interface to mark different tags for specific workloads. The bpf prog obtains the tags to detect different workloads.
2.Add BPF hook and helper to scheduling processes such as select_task_rq and pick_next_task to enable scalability.

It's a new attempt, and there's bound to be a lot of problems later, but it's exciting that it makes the schduler programmable.

cheers,
Ren Zhijie