diff options
author | David Miller <davem@davemloft.net> | 2020-02-24 15:01:46 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-02-24 16:20:09 -0800 |
commit | 2a916f2f546ca1c1e3323e2a4269307f6d9890eb (patch) | |
tree | 55001914de022407ab96c717dc6ba7aa90e124f1 /include/linux/filter.h | |
parent | 02ad05965491ca72034327d47da6cb25f3a92603 (diff) |
bpf: Use migrate_disable/enable in array macros and cgroup/lirc code.
Replace the preemption disable/enable with migrate_disable/enable() to
reflect the actual requirement and to allow PREEMPT_RT to substitute it
with an actual migration disable mechanism which does not disable
preemption.
Including the code paths that go via __bpf_prog_run_save_cb().
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200224145643.998293311@linutronix.de
Diffstat (limited to 'include/linux/filter.h')
-rw-r--r-- | include/linux/filter.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index 9270de2a0df8..43b5e455d2f5 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -677,6 +677,7 @@ static inline u8 *bpf_skb_cb(struct sk_buff *skb) return qdisc_skb_cb(skb)->data; } +/* Must be invoked with migration disabled */ static inline u32 __bpf_prog_run_save_cb(const struct bpf_prog *prog, struct sk_buff *skb) { @@ -702,9 +703,9 @@ static inline u32 bpf_prog_run_save_cb(const struct bpf_prog *prog, { u32 res; - preempt_disable(); + migrate_disable(); res = __bpf_prog_run_save_cb(prog, skb); - preempt_enable(); + migrate_enable(); return res; } |