aarch64 Linux: outline atomics never use LSE
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #166430 của @ali-vercel — đã đóng, không merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- compilers, performance
Hướng nghiên cứu
Read rust-lang/compiler-builtins#1354 first, then the aarch64 outline-atomics helpers that define __aarch64_ldadd8_acq_rel and the runtime LSE feature check they branch on. Reproduce with the issue's script, comparing the disassembly of nightly-2026-10-28 against nightly-2026-10-29 under qemu-aarch64 -cpu max. Done means the helper emits ldaddal again when the LSE feature bit is set. Note that pull request #166430 is already open against this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Ever since rust nightly 2026-10-29, outline atomics on aarch64 linux don't use LSE. Appears to have been caused by rust-lang/compiler-builtins#1354. This causes poor performance because it falls back to an LL/SC retry loop.
Reproduction
use std::sync::atomic::{AtomicU64, Ordering};
static COUNTER: AtomicU64 = AtomicU64::new(0);
fn main() {
COUNTER.fetch_add(1, Ordering::SeqCst);
}
Reproduction script to check arm64 instructions
Install rustup and qemu-user.#!/bin/bash
set -e
for toolchain in nightly-2026-10-28 nightly-2026-10-29; do
rustup -q toolchain install --profile minimal $toolchain
RUSTFLAGS="-C relocation-model=static" cargo +$toolchain build -q --release --target-dir target-$toolchain
bin=target-$toolchain/release/lsemin
helper=$(nm -S $bin | awk '/ __aarch64_ldadd8_acq_rel$/ {print "0x" $1 "+0x" $2}')
echo "== $toolchain"
qemu-aarch64 -cpu max -d in_asm -dfilter $helper $bin 2>&1 | grep '^0x'
done
Ran on qemu-aarch64 -cpu max. The helper __aarch64_ldadd8_acq_rel uses the following instructions
adrp x8, #0x460000
ldrb w8, [x8, #0xb0c]
cbz w8, #0x435a64
mov x16, x0
ldaxr x0, [x1]
add x17, x0, x16
stlxr w15, x17, [x1]
cbnz w15, #0x435a68
ret
But I expected it to use ldaddal. Here's output from nightly-2026-10-28.
adrp x16, #0x460000
ldrb w16, [x16, #0xb0c]
cbz w16, #0x435b14
ldaddal x0, x0, [x1]
ret
Claude Opus 5.5 helped me find and bisect this.
Meta
rustc +nightly-2026-10-29 --version --verbose:
rustc 1.101.0-nightly (92ffebece 2026-10-28)
binary: rustc
commit-hash: 92ffebeceaa0a071066f233873c2438e73d70fe7
commit-date: 2026-10-28
host: aarch64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.4
- Ngôn ngữ chính
- Rust
- Star
- 123k
- Fork
- 16.6k
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 532
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-lang/rust
-
strictly_dominates missing a `=`Đang mởC-bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
rust-lang/rust#166722 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-attributes relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-lang
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-run-make C-bug T-bootstrap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Tracking issue for release notes of #161531: Remove `T: Send + Sync` bound from `Arc::downcast`Đang mởrelnotes relnotes-tracking-issue T-libs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-str A-Unicode relnotes relnotes-tracking-issue T-libs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rust-lang/rust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
tamatebako/tebako#1155 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
swc-project/swc-next-issues#1148 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
registrystack/registry-stack#2828 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
SocketDev/socket-patch#2364 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày