diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 120536f4c6eb..0d9dbd90d025 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -72,6 +72,16 @@ static inline bool same_state_synchronize_rcu(unsigned long oldstate1, unsigned void __rcu_read_lock(void); void __rcu_read_unlock(void); +static inline void rcu_migrate_enable(void) +{ + migrate_enable(); +} + +static inline void rcu_migrate_disable(void) +{ + migrate_disable(); +} + /* * Defined as a macro as it is a very low level header included from * areas that don't even know about current. This gives the rcu_read_lock() @@ -105,6 +115,14 @@ static inline int rcu_preempt_depth(void) return 0; } +static inline void rcu_migrate_enable(void) +{ +} + +static inline void rcu_migrate_disable(void) +{ +} + #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ #ifdef CONFIG_RCU_LAZY diff --git a/kernel/bpf/bpf_cgrp_storage.c b/kernel/bpf/bpf_cgrp_storage.c index 148da8f7ff36..9bbe74cdf918 100644 --- a/kernel/bpf/bpf_cgrp_storage.c +++ b/kernel/bpf/bpf_cgrp_storage.c @@ -45,7 +45,7 @@ void bpf_cgrp_storage_free(struct cgroup *cgroup) { struct bpf_local_storage *local_storage; - migrate_disable(); + rcu_migrate_disable(); rcu_read_lock(); local_storage = rcu_dereference(cgroup->bpf_cgrp_storage); if (!local_storage) @@ -56,7 +56,7 @@ void bpf_cgrp_storage_free(struct cgroup *cgroup) bpf_cgrp_storage_unlock(); out: rcu_read_unlock(); - migrate_enable(); + rcu_migrate_enable(); } static struct bpf_local_storage_data * diff --git a/kernel/bpf/bpf_inode_storage.c b/kernel/bpf/bpf_inode_storage.c index 15a3eb9b02d9..548530feb4da 100644 --- a/kernel/bpf/bpf_inode_storage.c +++ b/kernel/bpf/bpf_inode_storage.c @@ -62,7 +62,7 @@ void bpf_inode_storage_free(struct inode *inode) if (!bsb) return; - migrate_disable(); + rcu_migrate_disable(); rcu_read_lock(); local_storage = rcu_dereference(bsb->storage); @@ -72,7 +72,7 @@ void bpf_inode_storage_free(struct inode *inode) bpf_local_storage_destroy(local_storage); out: rcu_read_unlock(); - migrate_enable(); + rcu_migrate_enable(); } static void *bpf_fd_inode_storage_lookup_elem(struct bpf_map *map, void *key) diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c index 0cbcae727079..25feb93d44a9 100644 --- a/kernel/bpf/bpf_iter.c +++ b/kernel/bpf/bpf_iter.c @@ -706,11 +706,11 @@ int bpf_iter_run_prog(struct bpf_prog *prog, void *ctx) rcu_read_unlock_trace(); } else { rcu_read_lock(); - migrate_disable(); + rcu_migrate_disable(); old_run_ctx = bpf_set_run_ctx(&run_ctx); ret = bpf_prog_run(prog, ctx); bpf_reset_run_ctx(old_run_ctx); - migrate_enable(); + rcu_migrate_enable(); rcu_read_unlock(); } diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c index 1109475953c0..cbbf1b72eece 100644 --- a/kernel/bpf/bpf_task_storage.c +++ b/kernel/bpf/bpf_task_storage.c @@ -70,7 +70,7 @@ void bpf_task_storage_free(struct task_struct *task) { struct bpf_local_storage *local_storage; - migrate_disable(); + rcu_migrate_disable(); rcu_read_lock(); local_storage = rcu_dereference(task->bpf_storage); @@ -82,7 +82,7 @@ void bpf_task_storage_free(struct task_struct *task) bpf_task_storage_unlock(); out: rcu_read_unlock(); - migrate_enable(); + rcu_migrate_enable(); } static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c index 180b630279b9..694635699d46 100644 --- a/kernel/bpf/cgroup.c +++ b/kernel/bpf/cgroup.c @@ -71,7 +71,7 @@ bpf_prog_run_array_cg(const struct cgroup_bpf *cgrp, u32 func_ret; run_ctx.retval = retval; - migrate_disable(); + rcu_migrate_disable(); rcu_read_lock(); array = rcu_dereference(cgrp->effective[atype]); item = &array->items[0]; @@ -89,7 +89,7 @@ bpf_prog_run_array_cg(const struct cgroup_bpf *cgrp, } bpf_reset_run_ctx(old_run_ctx); rcu_read_unlock(); - migrate_enable(); + rcu_migrate_enable(); return run_ctx.retval; } diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c index 0e364614c3a2..a0608152c394 100644 --- a/kernel/bpf/trampoline.c +++ b/kernel/bpf/trampoline.c @@ -900,7 +900,7 @@ static u64 notrace __bpf_prog_enter_recur(struct bpf_prog *prog, struct bpf_tram __acquires(RCU) { rcu_read_lock(); - migrate_disable(); + rcu_migrate_disable(); run_ctx->saved_run_ctx = bpf_set_run_ctx(&run_ctx->run_ctx); @@ -949,7 +949,7 @@ static void notrace __bpf_prog_exit_recur(struct bpf_prog *prog, u64 start, update_prog_stats(prog, start); this_cpu_dec(*(prog->active)); - migrate_enable(); + rcu_migrate_enable(); rcu_read_unlock(); } @@ -961,7 +961,7 @@ static u64 notrace __bpf_prog_enter_lsm_cgroup(struct bpf_prog *prog, * programs, not the shims. */ rcu_read_lock(); - migrate_disable(); + rcu_migrate_disable(); run_ctx->saved_run_ctx = bpf_set_run_ctx(&run_ctx->run_ctx); @@ -974,7 +974,7 @@ static void notrace __bpf_prog_exit_lsm_cgroup(struct bpf_prog *prog, u64 start, { bpf_reset_run_ctx(run_ctx->saved_run_ctx); - migrate_enable(); + rcu_migrate_enable(); rcu_read_unlock(); } @@ -1034,7 +1034,7 @@ static u64 notrace __bpf_prog_enter(struct bpf_prog *prog, __acquires(RCU) { rcu_read_lock(); - migrate_disable(); + rcu_migrate_disable(); run_ctx->saved_run_ctx = bpf_set_run_ctx(&run_ctx->run_ctx); @@ -1048,7 +1048,7 @@ static void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start, bpf_reset_run_ctx(run_ctx->saved_run_ctx); update_prog_stats(prog, start); - migrate_enable(); + rcu_migrate_enable(); rcu_read_unlock(); }