Skip to contentSkip to conversation

tools/sched_ext: Use u64 for kind field to fix ARM64 atomic ops

RFC PATCH In review Xuewen Yan 3 participants 3 messages Feb 9 – Feb 10

Subsystems (2)
lore
Share & tools
lore

Xuewen Yan

author
#0 lore raw

RFC PATCH 1/1 tools/sched_ext: Use u64 for kind field to fix ARM64 atomic ops

From: Guohua Yan <[email protected]>

There are following compile errors in arm64:

bpftools/CORE/scx_simple.bpf.c:144:2: error: unsupported atomic operation, please use 64 bit version

  144 |         UEI_RECORD(uei, ei);
      |         ^

Convert kind from int to u64 to resolve ARM64 atomic operation limitations. ARM64 primarily supports 64-bit atomic operations.

---
 tools/sched_ext/include/scx/user_exit_info_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sched_ext/include/scx/user_exit_info_common.h +1 -1
index 2d0981aedd89..5bad20faade1 100644
@@ -21,7 +21,7 @@ enum uei_sizes {
 };
 
 struct user_exit_info {
-	int		kind;
+	u64		kind;
 	s64		exit_code;
 	char		reason[UEI_REASON_LEN];
 	char		msg[UEI_MSG_LEN];
Signature · 1 line
2.25.1
reviewer
#1 lore raw
Quoted 10 lines · Xuewen Yan

From: Guohua Yan <[email protected]>

There are following compile errors in arm64:

bpftools/CORE/scx_simple.bpf.c:144:2: error: unsupported atomic operation, please use 64 bit version

  144 |         UEI_RECORD(uei, ei);
      |         ^

Convert kind from int to u64 to resolve ARM64 atomic operation limitations. ARM64 primarily supports 64-bit atomic operations.

Alexei says this is llvm bpf backend error and the answer is to upgrade to a modern llvm that defaults to -mcpu=v3.

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 10 lines · Tejun Heo
Quoted 8 lines · Xuewen Yan

From: Guohua Yan <[email protected]>

There are following compile errors in arm64:

bpftools/CORE/scx_simple.bpf.c:144:2: error: unsupported atomic operation, please use 64 bit version

  144 |         UEI_RECORD(uei, ei);
      |         ^
Quoted 5 lines
Quoted 2 lines

Convert kind from int to u64 to resolve ARM64 atomic operation limitations. ARM64 primarily supports 64-bit atomic operations.

Alexei says this is llvm bpf backend error and the answer is to upgrade to a modern llvm that defaults to -mcpu=v3.

Thank you for the insight. We'll upgrade our LLVM toolchain and test with -mcpu=v3.
Appreciate your guidance on this backend issue.

Thanks!