<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/sched_ext, branch v6.13.2</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.13.2</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.13.2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-12-04T19:47:39+00:00</updated>
<entry>
<title>sched_ext: fix application of sizeof to pointer</title>
<updated>2024-12-04T19:47:39+00:00</updated>
<author>
<name>guanjing</name>
<email>guanjing@cmss.chinamobile.com</email>
</author>
<published>2024-11-17T02:51:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f24d192985cbd6782850fdbb3839039da2f0ee76'/>
<id>urn:sha1:f24d192985cbd6782850fdbb3839039da2f0ee76</id>
<content type='text'>
sizeof when applied to a pointer typed expression gives the size of
the pointer.

The proper fix in this particular case is to code sizeof(*cpuset)
instead of sizeof(cpuset).

This issue was detected with the help of Coccinelle.

Fixes: 22a920209ab6 ("sched_ext: Implement tickless support")
Signed-off-by: guanjing &lt;guanjing@cmss.chinamobile.com&gt;
Acked-by: Andrea Righi &lt;arighi@nvidia.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>sched_ext: Add __weak to fix the build errors</title>
<updated>2024-12-03T20:27:26+00:00</updated>
<author>
<name>Honglei Wang</name>
<email>jameshongleiwang@126.com</email>
</author>
<published>2024-11-29T09:10:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=793baff3f24f16dab9061045e23eea67724feae6'/>
<id>urn:sha1:793baff3f24f16dab9061045e23eea67724feae6</id>
<content type='text'>
commit 5cbb302880f5 ("sched_ext: Rename
scx_bpf_dispatch[_vtime]_from_dsq*() -&gt; scx_bpf_dsq_move[_vtime]*()")
introduced several new functions which caused compilation errors when
compiled with clang.

Let's fix this by adding __weak markers.

Signed-off-by: Honglei Wang &lt;jameshongleiwang@126.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Fixes: 5cbb302880f5 ("sched_ext: Rename scx_bpf_dispatch[_vtime]_from_dsq*() -&gt; scx_bpf_dsq_move[_vtime]*()")
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
</content>
</entry>
<entry>
<title>sched_ext: Rename scx_bpf_dispatch[_vtime]_from_dsq*() -&gt; scx_bpf_dsq_move[_vtime]*()</title>
<updated>2024-11-11T17:06:16+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-11-11T17:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5cbb302880f50f3edf35f8c6a1d38b6948bf4d11'/>
<id>urn:sha1:5cbb302880f50f3edf35f8c6a1d38b6948bf4d11</id>
<content type='text'>
In sched_ext API, a repeatedly reported pain point is the overuse of the
verb "dispatch" and confusion around "consume":

- ops.dispatch()
- scx_bpf_dispatch[_vtime]()
- scx_bpf_consume()
- scx_bpf_dispatch[_vtime]_from_dsq*()

This overloading of the term is historical. Originally, there were only
built-in DSQs and moving a task into a DSQ always dispatched it for
execution. Using the verb "dispatch" for the kfuncs to move tasks into these
DSQs made sense.

Later, user DSQs were added and scx_bpf_dispatch[_vtime]() updated to be
able to insert tasks into any DSQ. The only allowed DSQ to DSQ transfer was
from a non-local DSQ to a local DSQ and this operation was named "consume".
This was already confusing as a task could be dispatched to a user DSQ from
ops.enqueue() and then the DSQ would have to be consumed in ops.dispatch().
Later addition of scx_bpf_dispatch_from_dsq*() made the confusion even worse
as "dispatch" in this context meant moving a task to an arbitrary DSQ from a
user DSQ.

Clean up the API with the following renames:

1. scx_bpf_dispatch[_vtime]()		-&gt; scx_bpf_dsq_insert[_vtime]()
2. scx_bpf_consume()			-&gt; scx_bpf_dsq_move_to_local()
3. scx_bpf_dispatch[_vtime]_from_dsq*()	-&gt; scx_bpf_dsq_move[_vtime]*()

This patch performs the third set of renames. Compatibility is maintained
by:

- The previous kfunc names are still provided by the kernel so that old
  binaries can run. Kernel generates a warning when the old names are used.

- compat.bpf.h provides wrappers for the new names which automatically fall
  back to the old names when running on older kernels. They also trigger
  build error if old names are used for new builds.

- scx_bpf_dispatch[_vtime]_from_dsq*() were already wrapped in __COMPAT
  macros as they were introduced during v6.12 cycle. Wrap new API in
  __COMPAT macros too and trigger build errors on both __COMPAT prefixed and
  naked usages of the old names.

The compat features will be dropped after v6.15.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Andrea Righi &lt;arighi@nvidia.com&gt;
Acked-by: Changwoo Min &lt;changwoo@igalia.com&gt;
Acked-by: Johannes Bechberger &lt;me@mostlynerdless.de&gt;
Acked-by: Giovanni Gherdovich &lt;ggherdovich@suse.com&gt;
Cc: Dan Schatzberg &lt;dschatzberg@meta.com&gt;
Cc: Ming Yang &lt;yougmark94@gmail.com&gt;
</content>
</entry>
<entry>
<title>sched_ext: Rename scx_bpf_consume() to scx_bpf_dsq_move_to_local()</title>
<updated>2024-11-11T17:06:16+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-11-11T17:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5209c03c8ed215357a4827496a71fd32167d83ef'/>
<id>urn:sha1:5209c03c8ed215357a4827496a71fd32167d83ef</id>
<content type='text'>
In sched_ext API, a repeatedly reported pain point is the overuse of the
verb "dispatch" and confusion around "consume":

- ops.dispatch()
- scx_bpf_dispatch[_vtime]()
- scx_bpf_consume()
- scx_bpf_dispatch[_vtime]_from_dsq*()

This overloading of the term is historical. Originally, there were only
built-in DSQs and moving a task into a DSQ always dispatched it for
execution. Using the verb "dispatch" for the kfuncs to move tasks into these
DSQs made sense.

Later, user DSQs were added and scx_bpf_dispatch[_vtime]() updated to be
able to insert tasks into any DSQ. The only allowed DSQ to DSQ transfer was
from a non-local DSQ to a local DSQ and this operation was named "consume".
This was already confusing as a task could be dispatched to a user DSQ from
ops.enqueue() and then the DSQ would have to be consumed in ops.dispatch().
Later addition of scx_bpf_dispatch_from_dsq*() made the confusion even worse
as "dispatch" in this context meant moving a task to an arbitrary DSQ from a
user DSQ.

Clean up the API with the following renames:

1. scx_bpf_dispatch[_vtime]()		-&gt; scx_bpf_dsq_insert[_vtime]()
2. scx_bpf_consume()			-&gt; scx_bpf_dsq_move_to_local()
3. scx_bpf_dispatch[_vtime]_from_dsq*()	-&gt; scx_bpf_dsq_move[_vtime]*()

This patch performs the second rename. Compatibility is maintained by:

- The previous kfunc names are still provided by the kernel so that old
  binaries can run. Kernel generates a warning when the old names are used.

- compat.bpf.h provides wrappers for the new names which automatically fall
  back to the old names when running on older kernels. They also trigger
  build error if old names are used for new builds.

The compat features will be dropped after v6.15.

v2: Comment and documentation updates.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Andrea Righi &lt;arighi@nvidia.com&gt;
Acked-by: Changwoo Min &lt;changwoo@igalia.com&gt;
Acked-by: Johannes Bechberger &lt;me@mostlynerdless.de&gt;
Acked-by: Giovanni Gherdovich &lt;ggherdovich@suse.com&gt;
Cc: Dan Schatzberg &lt;dschatzberg@meta.com&gt;
Cc: Ming Yang &lt;yougmark94@gmail.com&gt;
</content>
</entry>
<entry>
<title>sched_ext: Rename scx_bpf_dispatch[_vtime]() to scx_bpf_dsq_insert[_vtime]()</title>
<updated>2024-11-11T17:06:16+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-11-11T17:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc26abb1a19adbb91b79d25a2e74976633ece429'/>
<id>urn:sha1:cc26abb1a19adbb91b79d25a2e74976633ece429</id>
<content type='text'>
In sched_ext API, a repeatedly reported pain point is the overuse of the
verb "dispatch" and confusion around "consume":

- ops.dispatch()
- scx_bpf_dispatch[_vtime]()
- scx_bpf_consume()
- scx_bpf_dispatch[_vtime]_from_dsq*()

This overloading of the term is historical. Originally, there were only
built-in DSQs and moving a task into a DSQ always dispatched it for
execution. Using the verb "dispatch" for the kfuncs to move tasks into these
DSQs made sense.

Later, user DSQs were added and scx_bpf_dispatch[_vtime]() updated to be
able to insert tasks into any DSQ. The only allowed DSQ to DSQ transfer was
from a non-local DSQ to a local DSQ and this operation was named "consume".
This was already confusing as a task could be dispatched to a user DSQ from
ops.enqueue() and then the DSQ would have to be consumed in ops.dispatch().
Later addition of scx_bpf_dispatch_from_dsq*() made the confusion even worse
as "dispatch" in this context meant moving a task to an arbitrary DSQ from a
user DSQ.

Clean up the API with the following renames:

1. scx_bpf_dispatch[_vtime]()		-&gt; scx_bpf_dsq_insert[_vtime]()
2. scx_bpf_consume()			-&gt; scx_bpf_dsq_move_to_local()
3. scx_bpf_dispatch[_vtime]_from_dsq*()	-&gt; scx_bpf_dsq_move[_vtime]*()

This patch performs the first set of renames. Compatibility is maintained
by:

- The previous kfunc names are still provided by the kernel so that old
  binaries can run. Kernel generates a warning when the old names are used.

- compat.bpf.h provides wrappers for the new names which automatically fall
  back to the old names when running on older kernels. They also trigger
  build error if old names are used for new builds.

The compat features will be dropped after v6.15.

v2: Documentation updates.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Andrea Righi &lt;arighi@nvidia.com&gt;
Acked-by: Changwoo Min &lt;changwoo@igalia.com&gt;
Acked-by: Johannes Bechberger &lt;me@mostlynerdless.de&gt;
Acked-by: Giovanni Gherdovich &lt;ggherdovich@suse.com&gt;
Cc: Dan Schatzberg &lt;dschatzberg@meta.com&gt;
Cc: Ming Yang &lt;yougmark94@gmail.com&gt;
</content>
</entry>
<entry>
<title>sched_ext: Enable the ops breather and eject BPF scheduler on softlockup</title>
<updated>2024-11-08T20:42:22+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-11-05T21:49:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e32c260195e6ff72940ab7826e38e0a0066fc58f'/>
<id>urn:sha1:e32c260195e6ff72940ab7826e38e0a0066fc58f</id>
<content type='text'>
On 2 x Intel Sapphire Rapids machines with 224 logical CPUs, a poorly
behaving BPF scheduler can live-lock the system by making multiple CPUs bang
on the same DSQ to the point where soft-lockup detection triggers before
SCX's own watchdog can take action. It also seems possible that the machine
can be live-locked enough to prevent scx_ops_helper, which is an RT task,
from running in a timely manner.

Implement scx_softlockup() which is called when three quarters of
soft-lockup threshold has passed. The function immediately enables the ops
breather and triggers an ops error to initiate ejection of the BPF
scheduler.

The previous and this patch combined enable the kernel to reliably recover
the system from live-lock conditions that can be triggered by a poorly
behaving BPF scheduler on Intel dual socket systems.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Douglas Anderson &lt;dianders@chromium.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>sched_ext: Update scx_show_state.py to match scx_ops_bypass_depth's new type</title>
<updated>2024-11-05T21:45:27+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-11-05T21:45:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a759bf0dfc4db3cb6556fc79c7c98da3a46b2b80'/>
<id>urn:sha1:a759bf0dfc4db3cb6556fc79c7c98da3a46b2b80</id>
<content type='text'>
0e7ffff1b811 ("scx: Fix raciness in scx_ops_bypass()") converted
scx_ops_bypass_depth from an atomic to an int. Update scx_show_state.py
accordingly.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Fixes: 0e7ffff1b811 ("scx: Fix raciness in scx_ops_bypass()")
</content>
</entry>
<entry>
<title>sched_ext: Make cast_mask() inline</title>
<updated>2024-10-25T22:19:44+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-10-25T22:11:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7724abf0ca77460cb06ac3d5e4352a5c2289c3ae'/>
<id>urn:sha1:7724abf0ca77460cb06ac3d5e4352a5c2289c3ae</id>
<content type='text'>
cast_mask() doesn't do any actual work and is defined in a header file.
Force it to be inline. When it is not inlined and the function is not used,
it can cause verificaiton failures like the following:

  # tools/testing/selftests/sched_ext/runner -t minimal
  ===== START =====
  TEST: minimal
  DESCRIPTION: Verify we can load a fully minimal scheduler
  OUTPUT:
  libbpf: prog 'cast_mask': missing BPF prog type, check ELF section name '.text'
  libbpf: prog 'cast_mask': failed to load: -22
  libbpf: failed to load object 'minimal'
  libbpf: failed to load BPF skeleton 'minimal': -22
  ERR: minimal.c:20
  Failed to open and load skel
  not ok 1 minimal #
  =====  END  =====

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Fixes: a748db0c8c6a ("tools/sched_ext: Receive misc updates from SCX repo")
</content>
</entry>
<entry>
<title>sched_ext, scx_qmap: Add and use SCX_ENQ_CPU_SELECTED</title>
<updated>2024-10-07T20:16:18+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2024-09-27T23:46:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b671793c7d95f020791415cbbcc82b9c007d19c'/>
<id>urn:sha1:9b671793c7d95f020791415cbbcc82b9c007d19c</id>
<content type='text'>
scx_qmap and other schedulers in the SCX repo are using SCX_ENQ_WAKEUP to
tell whether ops.select_cpu() was called. This is incorrect as
ops.select_cpu() can be skipped in the wakeup path and leads to e.g.
incorrectly skipping direct dispatch for tasks that are bound to a single
CPU.

sched core has been updated to specify ENQUEUE_RQ_SELECTED if
-&gt;select_task_rq() was called. Map it to SCX_ENQ_CPU_SELECTED and update
scx_qmap to test it instead of SCX_ENQ_WAKEUP.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: David Vernet &lt;void@manifault.com&gt;
Cc: Daniel Hodges &lt;hodges.daniel.scott@gmail.com&gt;
Cc: Changwoo Min &lt;multics69@gmail.com&gt;
Cc: Andrea Righi &lt;andrea.righi@linux.dev&gt;
Cc: Dan Schatzberg &lt;schatzberg.dan@gmail.com&gt;
</content>
</entry>
<entry>
<title>sched_ext: Add __weak markers to BPF helper function decalarations</title>
<updated>2024-10-02T16:53:12+00:00</updated>
<author>
<name>Vishal Chourasia</name>
<email>vishalc@linux.ibm.com</email>
</author>
<published>2024-10-02T07:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fcbc423577ce28b5e470a2a47fed6724430cccdb'/>
<id>urn:sha1:fcbc423577ce28b5e470a2a47fed6724430cccdb</id>
<content type='text'>
Fix build errors by adding __weak markers to BPF helper function
declarations in header files. This resolves static assertion failures
in scx_qmap.bpf.c and scx_flatcg.bpf.c where functions like
scx_bpf_dispatch_from_dsq_set_slice, scx_bpf_dispatch_from_dsq_set_vtime,
and scx_bpf_task_cgroup were missing the __weak attribute.

[1] https://lore.kernel.org/all/ZvvfUqRNM4-jYQzH@linux.ibm.com

Signed-off-by: Vishal Chourasia &lt;vishalc@linux.ibm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
</feed>
