Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

how to use sched-ext #61

Closed
ChenJY1221 opened this issue Oct 14, 2023 · 9 comments
Closed

how to use sched-ext #61

ChenJY1221 opened this issue Oct 14, 2023 · 9 comments

Comments

@ChenJY1221
Copy link

excuse me,i'm a fresher about sched-ext,I'd like to use it in my project.Whatever my question is so simple,how can I use or how can I compile this project in my virtual mechine?I'm sorry this problem is a little immature,but it’s really important for me.Can anybody give me some help?

@ChenJY1221
Copy link
Author

I can't get the way to use sched-ext by the readme document

@ptr1337
Copy link

ptr1337 commented Oct 14, 2023

Hi,

Here is also a reddit post from decave about it:
https://www.reddit.com/r/sched_ext/comments/13k3eon/guide_to_compiling_sched_ext_and_schedulers/

Maybe it helps you.

@ChenJY1221
Copy link
Author

thanks a lot! I will try this method soon.

@Byte-Lab
Copy link
Collaborator

Byte-Lab commented Oct 16, 2023

Thanks for pointing @ChenJY1221 to that subreddit post, @ptr1337. I'm also creating a slack channel that you can join in the interim: https://join.slack.com/t/schedextworkspace/shared_invite/zt-24c4on3sk-sHlozdLfCZBODfwU6t6dbw

@ChenJY1221
Copy link
Author

@ptr1337 @Decave thx guys for helping me a lot!It seems that I have compiled the sched_ext sccessfully.What's more,would you tell how can I judge whether I have compile the project,it's without report error?And how can I use the framework next.I would appreciate so much for you generous help.

@ptr1337
Copy link

ptr1337 commented Oct 19, 2023

@ptr1337 @Decave thx guys for helping me a lot!It seems that I have compiled the sched_ext sccessfully.What's more,would you tell how can I judge whether I have compile the project,it's without report error?And how can I use the framework next.I would appreciate so much for you generous help.

Well, after you have compiled the kernel, you can go into $srcdir/tool/sched-ext and compile their the example schedulers.
Be sure, to have the dependencies installed and also the correct kernel configuration set.

If the schedulers have successfully compiled, you can find them in $srcdir/tool/sched-ext/build/bin and can load each scheduler with: sudo ./scx_rusty for example.

To use the framework, you could start writing your own scheduler (see the example schedulers)

@ChenJY1221
Copy link
Author

ChenJY1221 commented Oct 21, 2023

follows are my compile environment:
ubuntu:22.04 Linux virtual-machine 6.2.0-34-generic # 34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
clang:16.0.6
pahole:v1.25
rust version : rustc 1.75.0-nightly
pkg-config version:0.29.2

we have try to compile this project in the ubuntu and QEMU virtual machine.While we compile in the ubuntu22.04,there are some error as follows:
make -C /home/cjy/project/sched_ext-sched_ext/tools/lib/bpf OUTPUT=/home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build/obj/libbpf/
EXTRA_CFLAGS='-g -O0 -fPIC'
DESTDIR=/home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build prefix= all install_headers
cargo fetch --manifest-path=scx_rusty/Cargo.toml
make[1]: 进入目录“/home/cjy/project/sched_ext-sched_ext/tools/lib/bpf”
INSTALL libbpf_headers
HOSTLD /home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build/obj/libbpf/fixdep-in.o
/bin/sh: 1: ld.lld: not found
make[3]: *** [/home/cjy/project/sched_ext-sched_ext/tools/build/Makefile.build:156:/home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build/obj/libbpf/fixdep-in.o] error 127
make[2]: *** [Makefile:47:/home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build/obj/libbpf/fixdep-in.o] error 2
make[1]: *** [/home/cjy/project/sched_ext-sched_ext/tools/build/Makefile.include:5:fixdep] error 2
make[1]: 离开目录“/home/cjy/project/sched_ext-sched_ext/tools/lib/bpf”
make: *** [Makefile:140:/home/cjy/project/sched_ext-sched_ext/tools/sched_ext/build/obj/libbpf/libbpf.a] error 2

It seems that the ld.lld error should have been solved in previous sched_ext commit about cargo.toml in this link:d9988b4 , I'm not sure what's wrong about this ld.lld error.What's more,do I have some misunderstanding about the operating environment?we do have a little confused about this.We even began to consider whether the x86 and arm architectures had a negative impact on the running results.Whether it's because the operation environment or I have some error operation when I compile the kernel ?

I sincerely hope you can help us solve these confusions。

@ptr1337
Copy link

ptr1337 commented Oct 22, 2023

@ChenJY1221
You need to install lld. It seems like you dont have it installed.

@ChenJY1221
Copy link
Author

@ptr1337
I really don’t know how to thank you for your help during this time. I used "lld --version" to verify your guess. It is really because I am missing lld. I never thought it was for this reason. Sorry to trouble you all the time because of my lack of relevant knowledge. Now I have successfully compiled the sched_ext framework. I am ready to carry out the next step of work on this basis. Thank you again for your help, and I wish you the best in your future work and life. All the best.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants