aarch64 Linux: outline atomics never use LSE
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #166430 @ali-vercel による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 18/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- compilers, performance
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Rust
- スター
- 123k
- フォーク
- 16.6k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 532
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rust のほかの issue
-
C-bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
rust-lang/rust#166722 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-attributes relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-lang
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
A-run-make C-bug T-bootstrap
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Tracking issue for release notes of #161531: Remove `T: Send + Sync` bound from `Arc::downcast`オープンrelnotes relnotes-tracking-issue T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
A-str A-Unicode relnotes relnotes-tracking-issue T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug core-lang
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Windows microphone listing treats words in a device name as DirectShow labels対応中かも @Sujal-chaudhary が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clipy-recorder/clipy#447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
nightly-cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
max-sixty/worktrunk#4939 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信