Skip to content

Commit

Permalink
kfuncs: Spellcheck pass for newly added kfunc pages
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Reimerink <[email protected]>
  • Loading branch information
dylandreimerink committed Feb 2, 2025
1 parent 4c36364 commit 38bf759
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 32 deletions.
15 changes: 14 additions & 1 deletion .aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,17 @@ programmatically
tc
tcx
Netkit
netkit
netkit
sched
scx
IRQ
IRQs
DSQ
DSQs
natively
enqueue
enqueued
enqueues
variadic
cpumask
scalable
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
- [`bpf_task_get_cgroup1`](bpf_task_get_cgroup1.md)
- [`bpf_task_from_pid`](bpf_task_from_pid.md)
- [`bpf_task_from_vpid`](bpf_task_from_vpid.md)
- Funcs for memory allocator inspection
- KFuncs for memory allocator inspection
- [`bpf_get_kmem_cache`](bpf_get_kmem_cache.md)
- Kfuncs for casting pointers
- [`bpf_cast_to_kern_ctx`](bpf_cast_to_kern_ctx.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/bpf_get_dentry_xattr.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: "This page documents the 'bpf_get_dentry_xattr' eBPF kfunc, includi
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/ac13a4261afe81ca423eddd8e6571078fe2a7cea)
<!-- [/FEATURE_TAG] -->

This function gets xattr of a dentry.
This function gets extended attribute(<nospell>xattr</nospell>) of a directory entry(<nospell>dentry</nospell>).

## Definition

Get xattr `name__str` of `dentry` and store the output in `value_ptr`.
Get <nospell>xattr</nospell> `name__str` of `dentry` and store the output in `value_ptr`.

For security reasons, only `name__str` with prefix "user." is allowed.

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/bpf_get_kmem_cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This function returns slab cache information from a virtual address of a slab ob

This function returns slab cache information from a virtual address of a slab object.

It doesn't grab a reference count of the kmem_cache so the caller is responsible to manage the access. The returned point is marked as `PTR_UNTRUSTED`.
It doesn't grab a reference count of the `kmem_cache` so the caller is responsible to manage the access. The returned point is marked as `PTR_UNTRUSTED`.

**Parameters**

Expand Down
8 changes: 4 additions & 4 deletions docs/linux/kfuncs/bpf_path_d_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ description: "This page documents the 'bpf_path_d_path' eBPF kfunc, including it
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/d08e2045ebf0f5f2a97ad22cc7dae398b35354ba)
<!-- [/FEATURE_TAG] -->

This function resolve the pathname for the supplied path.
This function resolve the path name for the supplied path.

## Definition

Resolve the pathname for the supplied `path` and store it in `buf`. This BPF kfunc is the safer variant of the legacy [`bpf_d_path`](../helper-function/bpf_d_path.md) helper and should be used in place of [`bpf_d_path`](../helper-function/bpf_d_path.md) whenever possible. It enforces `KF_TRUSTED_ARGS` semantics, meaning that the supplied `path` must itself hold a valid reference, or else the BPF program will be outright rejected by the BPF verifier.
Resolve the path name for the supplied `path` and store it in `buf`. This BPF kfunc is the safer variant of the legacy [`bpf_d_path`](../helper-function/bpf_d_path.md) helper and should be used in place of [`bpf_d_path`](../helper-function/bpf_d_path.md) whenever possible. It enforces `KF_TRUSTED_ARGS` semantics, meaning that the supplied `path` must itself hold a valid reference, or else the BPF program will be outright rejected by the BPF verifier.

This BPF kfunc may only be called from BPF LSM programs.

**Parameters**

`path`: path to resolve the pathname for

`buf`: buffer to return the resolved pathname in
`buf`: buffer to return the resolved path name in

`buf__sz`: length of the supplied buffer

**Returns**

A positive integer corresponding to the length of the resolved pathname in *buf*, including the NUL termination character. On error, a negative integer is returned.
A positive integer corresponding to the length of the resolved path name in `buf`, including the `NULL` termination character. On error, a negative integer is returned.


**Signature**
Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/bpf_task_from_vpid.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Find a struct task_struct from its `vpid`.

## Definition

Find a struct task_struct from its vpid by looking it up in the pid namespace of the current task.
Find a struct `task_struct` from its `vpid` by looking it up in the `pid` namespace of the current task.

**Parameters**

Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ These kfuncs allow you to take a reference to a cGroup and store them as kptrs i
- [`bpf_task_from_pid`](bpf_task_from_pid.md)
- [`bpf_task_from_vpid`](bpf_task_from_vpid.md)

## Funcs for memory allocator inspection
## KFuncs for memory allocator inspection

- [`bpf_get_kmem_cache`](bpf_get_kmem_cache.md)

Expand Down Expand Up @@ -245,7 +245,7 @@ These kfuncs allow you to take a reference to a cGroup and store them as kptrs i
- [`bbr_init`](bbr_init.md)
- [`bbr_main`](bbr_main.md)
- [`bbr_sndbuf_expand`](bbr_sndbuf_expand.md)
- [`bbr_undo_cwnd`](bbr_undo_cwnd.md)scx_bpf_create_dsq
- [`bbr_undo_cwnd`](bbr_undo_cwnd.md)
- [`bbr_cwnd_event`](bbr_cwnd_event.md)
- [`bbr_ssthresh`](bbr_ssthresh.md)
- [`bbr_min_tso_segs`](bbr_min_tso_segs.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/scx_bpf_cpu_rq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ description: "This page documents the 'scx_bpf_cpu_rq' eBPF kfunc, including its
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/6203ef73fa5c0358f7960b038628259be1448724)
<!-- [/FEATURE_TAG] -->

This function fetches the rq (runqueue) of a CPU.
This function fetches the <nospell>rq</nospell> (run queue) of a CPU.

## Definition

**Parameters**

`cpu`: CPU of the rq
`cpu`: CPU of the <nospell>rq</nospell>

**Signature**

Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/scx_bpf_cpuperf_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ This function set the relative performance target of a CPU.

## Definition

Set the target performance level of `cpu` to `perf`. `perf` is in linear relative scale between `0` and `SCX_CPUPERF_ONE`. This determines how the schedutil cpufreq governor chooses the target frequency.
Set the target performance level of `cpu` to `perf`. `perf` is in linear relative scale between `0` and `SCX_CPUPERF_ONE`. This determines how the schedutil <nospell>cpufreq</nospell> governor chooses the target frequency.

The actual performance level chosen, CPU grouping, and the overhead and latency of the operations are dependent on the hardware and cpufreq driver in use. Consult hardware and cpufreq documentation for more information. The current performance level can be monitored using [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md).
The actual performance level chosen, CPU grouping, and the overhead and latency of the operations are dependent on the hardware and <nospell>cpufreq</nospell> driver in use. Consult hardware and <nospell>cpufreq</nospell> documentation for more information. The current performance level can be monitored using [`scx_bpf_cpuperf_cur`](scx_bpf_cpuperf_cur.md).

**Returns**

Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/scx_bpf_dsq_insert_vtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: "This page documents the 'scx_bpf_dsq_insert_vtime' eBPF kfunc, inc
[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/cc26abb1a19adbb91b79d25a2e74976633ece429)
<!-- [/FEATURE_TAG] -->

This function inserts a task into the vtime priority queue of a DSQ.
This function inserts a task into the `vtime` priority queue of a DSQ.

## Definition

Insert `p` into the vtime priority queue of the DSQ identified by `dsq_id`. Tasks queued into the priority queue are ordered by `vtime`. All other aspects are identical to [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md).
Insert `p` into the `vtime` priority queue of the DSQ identified by `dsq_id`. Tasks queued into the priority queue are ordered by `vtime`. All other aspects are identical to [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md).

`vtime` ordering is according to [`time_before64()`](https://elixir.bootlin.com/linux/v6.13/source/include/linux/jiffies.h#L212) which considers wrapping. A numerically larger vtime may indicate an earlier position in the ordering and vice-versa.

Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/scx_bpf_dsq_move_set_vtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: "This page documents the 'scx_bpf_dsq_move_set_vtime' eBPF kfunc, i
[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11)
<!-- [/FEATURE_TAG] -->

This function overrides vtime when moving between DSQs.
This function overrides `vtime` when moving between DSQs.

## Definition

Override the vtime of the next task that will be moved from `it__iter` using [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md). If this function is not called, the previous slice vtime is kept. If [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) is used to dispatch the next task, the override is ignored and cleared.
Override the `vtime` of the next task that will be moved from `it__iter` using [`scx_bpf_dsq_move_vtime`](scx_bpf_dsq_move_vtime.md). If this function is not called, the previous slice vtime is kept. If [`scx_bpf_dsq_move`](scx_bpf_dsq_move.md) is used to dispatch the next task, the override is ignored and cleared.

**Parameters**

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/scx_bpf_dsq_move_to_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This function moves a task from a DSQ to the current CPU's local DSQ.

Move a task from the non-local DSQ identified by `dsq_id` to the current CPU's local DSQ for execution. Can only be called from `ops.dispatch()`.

This function flushes the in-flight dispatches from [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) before trying to move from the specified DSQ. It may also grab rq locks and thus can't be called under any BPF locks.
This function flushes the in-flight dispatches from [`scx_bpf_dsq_insert`](scx_bpf_dsq_insert.md) before trying to move from the specified DSQ. It may also grab <nospell>rq</nospell> locks and thus can't be called under any BPF locks.

**Parameters**

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/scx_bpf_dsq_move_vtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "This page documents the 'scx_bpf_dsq_move_vtime' eBPF kfunc, inclu
[:octicons-tag-24: v6.13](https://github.com/torvalds/linux/commit/5cbb302880f50f3edf35f8c6a1d38b6948bf4d11)
<!-- [/FEATURE_TAG] -->

This function moves a task from DSQ iteration to a PRIQ DSQ.
This function moves a task from DSQ iteration to a <nospell>PRIQ</nospell> DSQ.

## Definition

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/scx_bpf_now.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ It provides the following properties:

1) High performance: Many BPF schedulers call [`bpf_ktime_get_ns`](../helper-function/bpf_ktime_get_ns.md) frequently to account for execution time and track tasks' runtime properties. Unfortunately, in some hardware platforms, [`bpf_ktime_get_ns`](../helper-function/bpf_ktime_get_ns.md) -- which eventually reads a hardware timestamp counter -- is neither performant nor scalable. `scx_bpf_now` aims to provide a high-performance clock by using the rq clock in the scheduler core whenever possible.

2) High enough resolution for the BPF scheduler use cases: In most BPF scheduler use cases, the required clock resolution is lower than the most accurate hardware clock (e.g., rdtsc in x86). `scx_bpf_now` basically uses the rq clock in the scheduler core whenever it is valid. It considers that the rq clock is valid from the time the rq clock is updated (`update_rq_clock`) until the rq is unlocked (`rq_unpin_lock`).
2) High enough resolution for the BPF scheduler use cases: In most BPF scheduler use cases, the required clock resolution is lower than the most accurate hardware clock (e.g., <nospell>rdtsc</nospell> in x86). `scx_bpf_now` basically uses the rq clock in the scheduler core whenever it is valid. It considers that the rq clock is valid from the time the rq clock is updated (`update_rq_clock`) until the rq is unlocked (`rq_unpin_lock`).

3) Monotonically non-decreasing clock for the same CPU: `scx_bpf_now` guarantees the clock never goes backward when comparing them in the same CPU. On the other hand, when comparing clocks in different CPUs, there is no such guarantee -- the clock can go backward. It provides a monotonically *non-decreasing* clock so that it would provide the same clock values in two different `scx_bpf_now` calls in the same CPU during the same period of when the rq clock is valid.

Expand Down
6 changes: 3 additions & 3 deletions docs/linux/kfuncs/scx_bpf_pick_any_cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: "This page documents the 'scx_bpf_pick_any_cpu' eBPF kfunc, includi
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f)
<!-- [/FEATURE_TAG] -->

Pick and claim an idle cpu if available or pick any CPU
Pick and claim an idle CPU if available or pick any CPU

## Definition

Pick and claim an idle cpu in `cpus_allowed`. If none is available, pick any CPU in `cpus_allowed`. Guaranteed to succeed.
Pick and claim an idle CPU in `cpus_allowed`. If none is available, pick any CPU in `cpus_allowed`. Guaranteed to succeed.

If `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE` is not set, this function can't tell which CPUs are idle and will always pick any CPU.

Expand All @@ -28,7 +28,7 @@ If `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE` is not set

**Returns**

The picked idle cpu number if `cpus_allowed` is not empty. `-EBUSY` is returned if `cpus_allowed` is empty.
The picked idle CPU number if `cpus_allowed` is not empty. `-EBUSY` is returned if `cpus_allowed` is empty.

**Signature**

Expand Down
6 changes: 3 additions & 3 deletions docs/linux/kfuncs/scx_bpf_pick_idle_cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: "This page documents the 'scx_bpf_pick_idle_cpu' eBPF kfunc, includ
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f)
<!-- [/FEATURE_TAG] -->

This function picks and claims an idle cpu.
This function picks and claims an idle CPU.

## Definition

Pick and claim an idle cpu in `cpus_allowed`.
Pick and claim an idle CPU in `cpus_allowed`.

Idle CPU tracking may race against CPU scheduling state transitions. For example, this function may return `-EBUSY` as CPUs are transitioning into the idle state. If the caller then assumes that there will be dispatch events on the CPUs as they were all busy, the scheduler may end up stalling with CPUs idling while there are pending tasks. Use [`scx_bpf_pick_any_cpu`](scx_bpf_pick_any_cpu.md) and [`scx_bpf_kick_cpu`](scx_bpf_kick_cpu.md) to guarantee that there will be at least one dispatch event in the near future.

Expand All @@ -30,7 +30,7 @@ Unavailable if `ops.update_idle()` is implemented and `SCX_OPS_KEEP_BUILTIN_IDLE

**Returns**

The picked idle cpu number on success. `-EBUSY` if no matching cpu was found.
The picked idle CPU number on success. `-EBUSY` if no matching cpu was found.

**Signature**

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/kfuncs/scx_bpf_put_idle_cpumask.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "This page documents the 'scx_bpf_put_idle_cpumask' eBPF kfunc, inc
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/f0e1a0643a59bf1f922fa209cec86a170b784f3f)
<!-- [/FEATURE_TAG] -->

This function releases a previously acquired referenced kptr to either the percpu, or SMT idle-tracking cpumask.
This function releases a previously acquired referenced kptr to either the per-CPU, or <nospell>SMT</nospell> idle-tracking cpumask.

## Definition

Expand Down
4 changes: 2 additions & 2 deletions docs/linux/kfuncs/scx_bpf_task_cgroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "This page documents the 'scx_bpf_task_cgroup' eBPF kfunc, includin
[:octicons-tag-24: v6.12](https://github.com/torvalds/linux/commit/8195136669661fdfe54e9a8923c33b31c92fc1da)
<!-- [/FEATURE_TAG] -->

This function returns the sched cgroup of a task.
This function returns the sched cGroup of a task.

## Definition

Expand All @@ -20,7 +20,7 @@ This function returns the sched cgroup of a task.

**Returns**

The sched cgroup of a task
The sched cGroup of a task

**Signature**

Expand Down

0 comments on commit 38bf759

Please sign in to comment.