Skip to content

Should eBPF programs always be run in a non-preemptible mode? #421

Answered by qmonnet
Alan-Jowett asked this question in Q&A
Discussion options

You must be logged in to vote

I don't have a perfect understanding on that level, but I think most programs are non-preemptible, as stated above.

However, there was a need for some programs to be “sleep-able”, so they could use, for example, helpers like bpf_copy_from_user() which is susceptible to sleep, and this was implemented last summer. This is the case for LSM programs in particular, if I remember correctly. Note that sleepable programs must be explicitly declared as such at load time (there is a BPF_F_SLEEPABLE flag that can be passed). See related commit log for details. Note that it might be extended in the future, the commit message states:

This is the first step of introducing sleepable progs. Eventually d…

Replies: 10 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Alan-Jowett
Comment options

@Alan-Jowett
Comment options

Comment options

You must be logged in to vote
1 reply
@Alan-Jowett
Comment options

Answer selected by dthaler
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@qmonnet
Comment options

@dthaler
Comment options

@teknoraver
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #385 on August 23, 2021 16:10.