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

Commit

Permalink
Merge pull request #146 from sched-ext/htejun
Browse files Browse the repository at this point in the history
tools/sched_ext: Bring back scx_central and scx_flatcg and simplify README
  • Loading branch information
Byte-Lab authored Feb 24, 2024
2 parents 118c263 + 5ded767 commit 74cfdbf
Show file tree
Hide file tree
Showing 7 changed files with 1,762 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tools/sched_ext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ $(INCLUDE_DIR)/%.bpf.skel.h: $(SCXOBJ_DIR)/%.bpf.o $(INCLUDE_DIR)/vmlinux.h $(BP

SCX_COMMON_DEPS := include/scx/common.h include/scx/user_exit_info.h | $(BINDIR)

c-sched-targets = scx_simple scx_qmap
c-sched-targets = scx_simple scx_qmap scx_central scx_flatcg

$(addprefix $(BINDIR)/,$(c-sched-targets)): \
$(BINDIR)/%: \
Expand Down
61 changes: 31 additions & 30 deletions tools/sched_ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,55 +154,56 @@ a full vmlinux.h file, you can compile the schedulers using `make`:
$ make -j($nproc)
```

# Schedulers
# Example schedulers

This directory contains the following simple schedulers as examples. For
more, visit https://github.com/sched-ext/scx.
This directory contains the following example schedulers. These schedulers are
for testing and demonstrating different aspects of sched_ext. While some may be
useful in limited scenarios, they are not intended to be practical.

--------------------------------------------------------------------------------
For more scheduler implementations, tools and documentation, visit
https://github.com/sched-ext/scx.

## scx_simple

### Overview
A simple scheduler that provides an example of a minimal sched_ext scheduler.
scx_simple can be run in either global weighted vtime mode, or FIFO mode.

A simple scheduler that provides an example of a minimal sched_ext
scheduler. scx_simple can be run in either global weighted vtime mode, or
FIFO mode.

### Typical Use Case

Though very simple, this scheduler should perform reasonably well on
single-socket CPUs with a uniform L3 cache topology. Note that while running in
global FIFO mode may work well for some workloads, saturating threads can
easily drown out inactive ones.

### Production Ready?

This scheduler could be used in a production environment, assuming the hardware
constraints enumerated above, and assuming the workload can accommodate a
simple scheduling policy.

--------------------------------------------------------------------------------
Though very simple, in limited scenarios, this scheduler can perform reasonably
well on single-socket systems with a unified L3 cache.

## scx_qmap

### Overview

Another simple, yet slightly more complex scheduler that provides an example of
a basic weighted FIFO queuing policy. It also provides examples of some common
useful BPF features, such as sleepable per-task storage allocation in the
`ops.prep_enable()` callback, and using the `BPF_MAP_TYPE_QUEUE` map type to
enqueue tasks. It also illustrates how core-sched support could be implemented.

### Typical Use Case
## scx_central

A "central" scheduler where scheduling decisions are made from a single CPU.
This scheduler illustrates how scheduling decisions can be dispatched from a
single CPU, allowing other cores to run with infinite slices, without timer
ticks, and without having to incur the overhead of making scheduling decisions.

The approach demonstrated by this scheduler may be useful for any workload that
benefits from minimizing scheduling overhead and timer ticks. An example of
where this could be particularly useful is running VMs, where running with
infinite slices and no timer ticks allows the VM to avoid unnecessary expensive
vmexits.

Purely used to illustrate sched_ext features.
## scx_flatcg

### Production Ready?
A flattened cgroup hierarchy scheduler. This scheduler implements hierarchical
weight-based cgroup CPU control by flattening the cgroup hierarchy into a single
layer, by compounding the active weight share at each level. The effect of this
is a much more performant CPU controller, which does not need to descend down
cgroup trees in order to properly compute a cgroup's share.

No
Similar to scx_simple, in limited scenarios, this scheduler can perform
reasonably well on single socket-socket systems with a unified L3 cache and show
significantly lowered hierarchical scheduling overhead.

--------------------------------------------------------------------------------

# Troubleshooting

Expand Down
Loading

0 comments on commit 74cfdbf

Please sign in to comment.