diff mbox series

[bpf] bpf: update bpf_get_smp_processor_id() documentation

Message ID 20210914222306.52522-1-mcroce@linux.microsoft.com (mailing list archive)
State Superseded
Delegated to: BPF
Headers show
Series [bpf] bpf: update bpf_get_smp_processor_id() documentation | expand

Checks

Context Check Description
bpf/vmtest-bpf success VM_Test
bpf/vmtest-bpf-PR success PR summary
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for bpf
netdev/subject_prefix success Link
netdev/cc_maintainers fail 2 blamed authors not CCed: josef@toxicpanda.com kpsingh@kernel.org; 7 maintainers not CCed: kpsingh@kernel.org john.fastabend@gmail.com yhs@fb.com songliubraving@fb.com netdev@vger.kernel.org josef@toxicpanda.com kafai@fb.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 11864 this patch: 11864
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch warning WARNING: please, no space before tabs
netdev/build_allmodconfig_warn success Errors and warnings before: 11497 this patch: 11497
netdev/header_inline success Link

Commit Message

Matteo Croce Sept. 14, 2021, 10:23 p.m. UTC
From: Matteo Croce <mcroce@microsoft.com>

Since commit 1e6c62a88215 ("bpf: Introduce sleepable BPF programs"), BPF
programs can sleep if the BPF_F_SLEEPABLE flag is set.
Update the documentation accordingly.

Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
---
 include/uapi/linux/bpf.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Yonghong Song Sept. 14, 2021, 11:01 p.m. UTC | #1
On 9/14/21 3:23 PM, Matteo Croce wrote:
> From: Matteo Croce <mcroce@microsoft.com>
> 
> Since commit 1e6c62a88215 ("bpf: Introduce sleepable BPF programs"), BPF
> programs can sleep if the BPF_F_SLEEPABLE flag is set.
> Update the documentation accordingly.
> 
> Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")

I think we don't need this Fixes tag as this patch should target to
bpf-next tree. There is no need to backport to bpf tree since it is
just a documentation change.

Based on *current* implementation, referring to sleepable BPF
program commit is not needed any more. See below for the suggested
change.

> Signed-off-by: Matteo Croce <mcroce@microsoft.com>
> ---
>   include/uapi/linux/bpf.h | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index d21326558d42..5e3b2fb62d84 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -1629,9 +1629,9 @@ union bpf_attr {
>    * u32 bpf_get_smp_processor_id(void)
>    * 	Description
>    * 		Get the SMP (symmetric multiprocessing) processor id. Note that
> - * 		all programs run with preemption disabled, which means that the
> - * 		SMP processor id is stable during all the execution of the
> - * 		program.
> + * 		programs run with preemption disabled unless BPF_F_SLEEPABLE is
> + * 		set, which means that the SMP processor id is stable during all
> + * 		the execution of the program.

Currently, migrate_disable() means true migration disable and preemption 
is possible, and BPF_F_SLEEPABLE programs are also protected by 
migrate_disable().

So the patch should just change "with preemption disabled" to
"with migration disabled" to reflect the new implementation.

>    * 	Return
>    * 		The SMP id of the processor running the program.
>    *
>
diff mbox series

Patch

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index d21326558d42..5e3b2fb62d84 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -1629,9 +1629,9 @@  union bpf_attr {
  * u32 bpf_get_smp_processor_id(void)
  * 	Description
  * 		Get the SMP (symmetric multiprocessing) processor id. Note that
- * 		all programs run with preemption disabled, which means that the
- * 		SMP processor id is stable during all the execution of the
- * 		program.
+ * 		programs run with preemption disabled unless BPF_F_SLEEPABLE is
+ * 		set, which means that the SMP processor id is stable during all
+ * 		the execution of the program.
  * 	Return
  * 		The SMP id of the processor running the program.
  *