aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2024-04-06 13:00:32 +0200
committerIngo Molnar <mingo@kernel.org>2024-04-06 13:00:32 +0200
commit5f2ca44ed235c86a0d6b9bfb599d1664ea94b4b9 (patch)
tree0475ba937cecc36b1e38afcd0f3babba23092aba /include/linux/bpf.h
parentx86/mce: Make sure to grab mce_sysfs_mutex in set_bank() (diff)
parentMerge tag 'firewire-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 (diff)
downloadwireguard-linux-5f2ca44ed235c86a0d6b9bfb599d1664ea94b4b9.tar.xz
wireguard-linux-5f2ca44ed235c86a0d6b9bfb599d1664ea94b4b9.zip
Merge branch 'linus' into x86/urgent, to pick up dependent commit
We want to fix: 0e110732473e ("x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO") So merge in Linus's latest into x86/urgent to have it available. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 4f20f62f9d63..890e152d553e 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1574,12 +1574,26 @@ struct bpf_link {
enum bpf_link_type type;
const struct bpf_link_ops *ops;
struct bpf_prog *prog;
- struct work_struct work;
+ /* rcu is used before freeing, work can be used to schedule that
+ * RCU-based freeing before that, so they never overlap
+ */
+ union {
+ struct rcu_head rcu;
+ struct work_struct work;
+ };
};
struct bpf_link_ops {
void (*release)(struct bpf_link *link);
+ /* deallocate link resources callback, called without RCU grace period
+ * waiting
+ */
void (*dealloc)(struct bpf_link *link);
+ /* deallocate link resources callback, called after RCU grace period;
+ * if underlying BPF program is sleepable we go through tasks trace
+ * RCU GP and then "classic" RCU GP
+ */
+ void (*dealloc_deferred)(struct bpf_link *link);
int (*detach)(struct bpf_link *link);
int (*update_prog)(struct bpf_link *link, struct bpf_prog *new_prog,
struct bpf_prog *old_prog);