Skip to content

Commit

Permalink
Merge pull request #5 from sched-ext/v6.7.1-scx1
Browse files Browse the repository at this point in the history
V6.7.1 scx1
  • Loading branch information
htejun authored Jan 29, 2024
2 parents 0dd3ee3 + e4fafc7 commit 5a034c9
Show file tree
Hide file tree
Showing 189 changed files with 21,354 additions and 768 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/run-schedulers
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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

# 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.
#
# TODO: exclude scx_layered for now, because it requires a special config
# file, otherwise its test would fail with "Error: No layer spec".
#
# Maybe in the future change scx_layered to run with a default layer spec, just
# for testing it.
#
for sched in $(find tools/sched_ext/build/bin -type f -executable | grep -v scx_layered); do
rm -f /tmp/output
(timeout --foreground --preserve-status ${GUEST_TIMEOUT} \
vng --force-9p --disable-microvm --verbose -- \
"timeout --foreground --preserve-status ${TEST_TIMEOUT} ${sched}" \
2>&1 </dev/null || true) | tee /tmp/output
sed -n -e '/\bBUG:/q1' \
-e '/\bWARNING:/q1' \
-e '/\berror\b/Iq1' \
-e '/\bstall/Iq1' \
-e '/\btimeout\b/Iq1' /tmp/output
res=$?
if [ ${res} -ne 0 ]; then
echo "FAIL: ${sched}"
exit 1
else
echo "OK: ${sched}"
fi
done
34 changes: 34 additions & 0 deletions .github/workflows/sched-ext.config
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
47 changes: 47 additions & 0 deletions .github/workflows/test-kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: test-kernel
run-name: ${{ github.actor }} PR run
on: [pull_request, push]
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 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

# 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/Decave/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 in-kernel schedulers
- run: cd tools/sched_ext && make

# Test the schedulers inside the recompile kernel
- run: .github/workflows/run-schedulers
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,6 @@ sphinx_*/

# Rust analyzer configuration
/rust-project.json

# Include ".github" directory
!.github/
2 changes: 1 addition & 1 deletion Documentation/admin-guide/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features
.. kernel-feat:: features
2 changes: 1 addition & 1 deletion Documentation/arch/arc/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features arc
.. kernel-feat:: features arc
2 changes: 1 addition & 1 deletion Documentation/arch/arm/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features arm
.. kernel-feat:: features arm
2 changes: 1 addition & 1 deletion Documentation/arch/arm64/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features arm64
.. kernel-feat:: features arm64
2 changes: 1 addition & 1 deletion Documentation/arch/loongarch/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features loongarch
.. kernel-feat:: features loongarch
2 changes: 1 addition & 1 deletion Documentation/arch/m68k/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features m68k
.. kernel-feat:: features m68k
2 changes: 1 addition & 1 deletion Documentation/arch/mips/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features mips
.. kernel-feat:: features mips
2 changes: 1 addition & 1 deletion Documentation/arch/nios2/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features nios2
.. kernel-feat:: features nios2
2 changes: 1 addition & 1 deletion Documentation/arch/openrisc/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features openrisc
.. kernel-feat:: features openrisc
2 changes: 1 addition & 1 deletion Documentation/arch/parisc/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features parisc
.. kernel-feat:: features parisc
2 changes: 1 addition & 1 deletion Documentation/arch/powerpc/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features powerpc
.. kernel-feat:: features powerpc
2 changes: 1 addition & 1 deletion Documentation/arch/riscv/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features riscv
.. kernel-feat:: features riscv
2 changes: 1 addition & 1 deletion Documentation/arch/s390/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features s390
.. kernel-feat:: features s390
2 changes: 1 addition & 1 deletion Documentation/arch/sh/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features sh
.. kernel-feat:: features sh
2 changes: 1 addition & 1 deletion Documentation/arch/sparc/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features sparc
.. kernel-feat:: features sparc
2 changes: 1 addition & 1 deletion Documentation/arch/x86/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features x86
.. kernel-feat:: features x86
2 changes: 1 addition & 1 deletion Documentation/arch/xtensa/features.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. SPDX-License-Identifier: GPL-2.0
.. kernel-feat:: $srctree/Documentation/features xtensa
.. kernel-feat:: features xtensa
1 change: 1 addition & 0 deletions Documentation/scheduler/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Scheduler
sched-nice-design
sched-rt-group
sched-stats
sched-ext
sched-debug

text_files
Expand Down
Loading

0 comments on commit 5a034c9

Please sign in to comment.