[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250807024800.39491-1-wangfushuai@baidu.com>
Date: Thu, 7 Aug 2025 10:48:00 +0800
From: Fushuai Wang <wangfushuai@...du.com>
To: <linux-kernel@...r.kernel.org>, <bpf@...r.kernel.org>
CC: <martin.lau@...ux.dev>, <ast@...nel.org>, <daniel@...earbox.net>,
<andrii@...nel.org>, <eddyz87@...il.com>, <song@...nel.org>,
<yonghong.song@...ux.dev>, <john.fastabend@...il.com>, <kpsingh@...nel.org>,
<sdf@...ichev.me>, <haoluo@...gle.com>, <jolsa@...nel.org>, Fushuai Wang
<wangfushuai@...du.com>
Subject: [PATCH bpf] bpf: Use cpumask_next_wrap() in get_next_cpu()
Replace the manual sequence of cpumask_next() and cpumask_first()
with a single call to cpumask_next_wrap() in get_next_cpu().
Signed-off-by: Fushuai Wang <wangfushuai@...du.com>
---
kernel/bpf/bpf_lru_list.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/bpf/bpf_lru_list.c b/kernel/bpf/bpf_lru_list.c
index 2d6e1c98d8ad..34881f4da8ae 100644
--- a/kernel/bpf/bpf_lru_list.c
+++ b/kernel/bpf/bpf_lru_list.c
@@ -21,10 +21,7 @@
static int get_next_cpu(int cpu)
{
- cpu = cpumask_next(cpu, cpu_possible_mask);
- if (cpu >= nr_cpu_ids)
- cpu = cpumask_first(cpu_possible_mask);
- return cpu;
+ return cpumask_next_wrap(cpu, cpu_possible_mask);
}
/* Local list helpers */
--
2.36.1
Powered by blists - more mailing lists