-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from sched-ext/scx-6.10rc2-scx1
v6.10-rc2-scx1
- Loading branch information
Showing
186 changed files
with
17,379 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
# | ||
# Run sched-ext scheduler for TIMEOUT seconds inside virtme-ng and catch | ||
# potential errors, then unload the scheduler and return the exit status. | ||
|
||
# Maximum time for each scheduler run. | ||
TEST_TIMEOUT=30 | ||
|
||
# Maximum timeout for the guest used for each scheduler run (this is used to | ||
# hard-shutdown the guest in case of system hangs). | ||
GUEST_TIMEOUT=60 | ||
|
||
# Check if virtme-ng is available. | ||
if [ ! -x `which vng` ]; then | ||
echo "vng not found, please install virtme-ng to enable testing" | ||
exit 1 | ||
fi | ||
|
||
function runtest() { | ||
local bin="${1}" | ||
|
||
if [ -z "${bin}" ]; then | ||
echo "No binary passed to runtest" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -f "${bin}" ]; then | ||
echo "Binary ${bin} was not a regular file" | ||
exit 1 | ||
fi | ||
|
||
rm -f /tmp/output | ||
(timeout --foreground --preserve-status ${GUEST_TIMEOUT} \ | ||
vng --force-9p --verbose -- \ | ||
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${bin}" \ | ||
2>&1 </dev/null || true) | tee /tmp/output | ||
} | ||
|
||
# Test all the available schedulers. | ||
# | ||
# NOTE: virtme-ng automatically runs the kernel from the current working | ||
# directory by default. | ||
# | ||
# Each scheduler will be tested in a separate instance booted from scratch, to | ||
# ensure that each run does not impact the others. | ||
# | ||
for sched in $(find tools/sched_ext/build/bin -type f -executable); do | ||
runtest "${sched}" | ||
grep -v " Speculative Return Stack Overflow" /tmp/output | \ | ||
sed -n -e '/\bBUG:/q1' \ | ||
-e '/\bWARNING:/q1' \ | ||
-e '/\berror\b/Iq1' \ | ||
-e '/\bstall/Iq1' \ | ||
-e '/\btimeout\b/Iq1' | ||
res=$? | ||
if [ ${res} -ne 0 ]; then | ||
echo "FAIL: ${sched}" | ||
exit 1 | ||
else | ||
echo "OK: ${sched}" | ||
fi | ||
done | ||
|
||
# Run the selftests suite | ||
runtest "tools/testing/selftests/sched_ext/runner" | ||
sed -n -e '/not ok/q1' /tmp/output | ||
res=$? | ||
if [ ${res} -ne 0 ]; then | ||
echo "FAIL: selftests" | ||
echo "output: $(cat /tmp/output)" | ||
else | ||
echo "OK: selftests" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# sched-ext mandatory options | ||
# | ||
CONFIG_BPF=y | ||
CONFIG_BPF_SYSCALL=y | ||
CONFIG_BPF_JIT=y | ||
CONFIG_DEBUG_INFO_BTF=y | ||
CONFIG_BPF_JIT_ALWAYS_ON=y | ||
CONFIG_BPF_JIT_DEFAULT_ON=y | ||
CONFIG_SCHED_CLASS_EXT=y | ||
|
||
# Enable scheduling debugging | ||
# | ||
CONFIG_SCHED_DEBUG=y | ||
|
||
# Enable extra scheduling features (for a better code coverage while testing | ||
# the schedulers) | ||
# | ||
CONFIG_SCHED_AUTOGROUP=y | ||
CONFIG_SCHED_CORE=y | ||
|
||
# Enable fully preemptible kernel for a better test coverage of the schedulers | ||
# | ||
# CONFIG_PREEMPT_NONE is not set | ||
# CONFIG_PREEMPT_VOLUNTARY is not set | ||
CONFIG_PREEMPT=y | ||
CONFIG_PREEMPT_COUNT=y | ||
CONFIG_PREEMPTION=y | ||
CONFIG_PREEMPT_DYNAMIC=y | ||
CONFIG_PREEMPT_RCU=y | ||
|
||
# Additional debugging information (useful to catch potential locking issues) | ||
# | ||
CONFIG_DEBUG_LOCKDEP=y | ||
CONFIG_DEBUG_ATOMIC_SLEEP=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: test-kernel | ||
run-name: ${{ github.actor }} PR run | ||
on: [pull_request] | ||
jobs: | ||
test-schedulers: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
### OTHER REPOS #### | ||
|
||
# Hard turn-off interactive mode | ||
- run: echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections | ||
|
||
# Refresh packages list | ||
- run: sudo apt update | ||
|
||
### DOWNLOAD AND INSTALL DEPENDENCIES ### | ||
|
||
# Download dependencies packaged by Ubuntu | ||
- run: sudo apt -y install bc gcc make git coreutils cmake elfutils libelf-dev libunwind-dev libzstd-dev linux-headers-generic linux-tools-common linux-tools-generic ninja-build python3-pip python3-requests qemu-kvm udev iproute2 busybox-static libvirt-clients kbd kmod file rsync zstd pahole flex bison cpio libcap-dev libelf-dev python3-dev cargo rustc gcc-multilib | ||
|
||
# clang 17 | ||
# Use a custom llvm.sh script which includes the -y flag for | ||
# add-apt-repository. Otherwise, the CI job will hang. If and when | ||
# https://github.com/opencollab/llvm-jenkins.debian.net/pull/26 is | ||
# merged, we can go back to using https://apt.llvm.org/llvm.sh. | ||
- run: wget https://raw.githubusercontent.com/Byte-Lab/llvm-jenkins.debian.net/fix_llvmsh/llvm.sh | ||
- run: chmod +x llvm.sh | ||
- run: sudo ./llvm.sh all | ||
- run: sudo ln -sf /usr/bin/clang-17 /usr/bin/clang | ||
- run: sudo ln -sf /usr/bin/llvm-strip-17 /usr/bin/llvm-strip | ||
|
||
# Checkout repository | ||
- uses: actions/checkout@v4 | ||
|
||
# Install virtme-ng | ||
- run: pip install virtme-ng | ||
|
||
### END DEPENDENCIES ### | ||
|
||
# Build a minimal kernel (with sched-ext enabled) using virtme-ng | ||
- run: vng -v --build --config .github/workflows/sched-ext.config | ||
|
||
# Build the selftests suite | ||
- run: make -j $(nproc) -C tools/testing/selftests/sched_ext | ||
|
||
# Build the in-kernel schedulers | ||
- run: make -j $(nproc) -C tools/sched_ext | ||
|
||
# Setup KVM support | ||
- run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
# Test the schedulers inside the recompile kernel | ||
- run: .github/workflows/run-schedulers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,3 +171,6 @@ sphinx_*/ | |
|
||
# Rust analyzer configuration | ||
/rust-project.json | ||
|
||
# Include ".github" directory | ||
!.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.