Skip to contentSkip to conversation

cgroup: Fix 64-bit division in cgroup.stat.local

PATCH Applied Tiffany Yang 2 participants 2 messages Aug 23, 2025 – Aug 25, 2025 cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: Fix 64-bit division in cgroup.stat.local

Fix the following build error for 32-bit systems:
arm-linux-gnueabi-ld: kernel/cgroup/cgroup.o: in function `cgroup_core_local_stat_show':

Quoted 1 line
Quoted 1 line

kernel/cgroup/cgroup.c:3781:(.text+0x28f4): undefined reference to `__aeabi_uldivmod'

arm-linux-gnueabi-ld: (__aeabi_uldivmod): Unknown destination type (ARM/Thumb) in kernel/cgroup/cgroup.o

Quoted 1 line
Quoted 1 line

kernel/cgroup/cgroup.c:3781:(.text+0x28f4): dangerous relocation: unsupported relocation

---
This patch is based on top of tj/cgroup.git:for-6.18

---
 kernel/cgroup/cgroup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup/cgroup.c +2 -2
index ab096b884bbc..b38d7a847ed4 100644
@@ -3778,8 +3778,8 @@ static int cgroup_core_local_stat_show(struct seq_file *seq, void *v)
 					cgrp->freezer.freeze_start_nsec);
 	} while (read_seqcount_retry(&cgrp->freezer.freeze_seq, sequence));
 
-	seq_printf(seq, "frozen_usec %llu\n",
-		   (unsigned long long) freeze_time / NSEC_PER_USEC);
+	do_div(freeze_time, NSEC_PER_USEC);
+	seq_printf(seq, "frozen_usec %llu\n", freeze_time);
 
 	return 0;
 }
Signature · 1 line
2.51.0.rc2.233.g662b1ed5c5-goog
maintainer Applied
#1 lore raw
Quoted 10 lines · Tiffany Yang

Fix the following build error for 32-bit systems:
arm-linux-gnueabi-ld: kernel/cgroup/cgroup.o: in function `cgroup_core_local_stat_show':

Quoted 1 line
Quoted 1 line

kernel/cgroup/cgroup.c:3781:(.text+0x28f4): undefined reference to `__aeabi_uldivmod'

arm-linux-gnueabi-ld: (__aeabi_uldivmod): Unknown destination type (ARM/Thumb) in kernel/cgroup/cgroup.o

Quoted 1 line
Quoted 1 line

kernel/cgroup/cgroup.c:3781:(.text+0x28f4): dangerous relocation: unsupported relocation

Applied to cgroup/for-6.18.

Thanks.

Signature · 1 line
tejun