[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250815061824.765906-7-dongml2@chinatelecom.cn>
Date: Fri, 15 Aug 2025 14:18:23 +0800
From: Menglong Dong <menglong8.dong@...il.com>
To: ast@...nel.org
Cc: daniel@...earbox.net,
john.fastabend@...il.com,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH bpf-next 6/7] bpf: use rcu_migrate_* for bpf_prog_run_array_cg()
Replace the migrate_disable/migrate_enable with
rcu_migrate_disable/rcu_migrate_enable in bpf_prog_run_array_cg to obtain
better performance when PREEMPT_RCU is not enabled.
Signed-off-by: Menglong Dong <dongml2@...natelecom.cn>
---
kernel/bpf/cgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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;
}
--
2.50.1
Powered by blists - more mailing lists