🌴 Sync 2026-10-28 19:48:41

This commit is contained in:
github-actions[bot] committed 2026-10-28 19:48:41 +08:00
1 parent 6777dc608e
commit edb4912e45
8 files changed
+116 -37

No files matched your search

+11 -1
View File
@@ -11,7 +11,17 @@ cpu_arch="$(awk -F ': ' '/model name/ {print $2}' "$CPUINFO_PATH" | head -n1)"
case "$DISTRIB_TARGET" in
"x86"/*)
cpu_cores="$(grep "core id" "$CPUINFO_PATH" | sort -u | wc -l)C $(grep -c "processor" "$CPUINFO_PATH")T" ;;
procs="$(grep -c "processor" "$CPUINFO_PATH")"
sibs="$(awk -F ': *' '/^siblings/ {print $2; exit}' "$CPUINFO_PATH")"
case "$sibs" in ''|*[!0-9]*) sibs="" ;; esac
if [ -n "$sibs" ] && [ "$procs" -lt "$sibs" ]; then
# Partial CPU view (e.g. LXC container): host core ids leak
# through /proc/cpuinfo and can repeat - count the assigned
# CPUs as cores/threads
cpu_cores="${procs}C ${procs}T"
else
cpu_cores="$(grep "core id" "$CPUINFO_PATH" | sort -u | wc -l)C ${procs}T"
fi ;;
*)
cpu_cores="$(grep -c "processor" "$CPUINFO_PATH")" ;;
esac