Zum Hauptinhalt springen
Intelligence View
⚡ tsecurity.de Intelligence

acquire/release semantics in the kernel

With the need for better scaling on increasingly larger multi-core systems, we've continued to extend our CPU barriers in the kernel. Two important variants to…

Beitrag
0
Seite
0
↗ Quelle (blog.stgolabs.net)
Cloud & Tech-Stack · 4 Min. Lesezeit
Quelle: blog.stgolabs.net
Rubrik: Unix & Linux Server


With the need for better scaling on increasingly larger multi-core
systems, we've continued to extend our CPU barriers in the kernel. Two important variants to prevent CPU reordering for lock-free shared memory synchronization are pairs of load/acquire and store/release barriers; also known as LOCK/UNLOCK barriers. These enable threads to cooperate between each other.



Multiple, yet pretty much equivalent, definitions of acquire/release semantics can be found all over the internet, but I like the version from the infamous 'Documentation/memory-barriers.txt' file for three reasons: (i) it is clear and concise, (ii) it explicitly warns that they are the minimum operations and not to assume anything about reordering of loads and stores before or after the acquire or release, respectively. Finally, (iii) it strongly mentions the need for pairing and thus portability:



 (5) ACQUIRE operations.

     This acts as a one-way permeable barrier.  It guarantees that all memory operations after the ACQUIRE operation will appear to happen after the CQUIRE operation with respect to the other components of the system. ACQUIRE operations include LOCK operations and smp_load_acquire() operations.

     Memory operations that occur before an ACQUIRE operation may appear tohappen after it completes.

     An ACQUIRE operation should almost always be paired with a RELEASE operation.




 (6) RELEASE operations.

     This also acts as a one-way permeable barrier.  It guarantees that all   memory operations before the RELEASE operation will appear to happen before the RELEASE operation with respect to the other components of the system. RELEASE operations include UNLOCK operations and smp_store_release() operations.

     Memory operations that occur after a RELEASE operation may appear to happen before it completes.

     The use of ACQUIRE and RELEASE operations generally precludes the need for other sorts of memory barrier (but note the exceptions mentioned in the subsection "MMIO write barrier").  In addition, a RELEASE+ACQUIRE pair is -not- guaranteed to act as a full memory barrier.  However, after an ACQUIRE on a given variable, all memory accesses preceding any prior RELEASE on that same variable are guaranteed to be visible.  In other words, within a given variable's critical section, all accesses of all previous critical sections for that variable are guaranteed to have completed.

     This means that ACQUIRE acts as a minimal "acquire" operation and    RELEASE acts as a minimal "release" operation.




Thread B's ACQUIRE pairs with Thread A's RELEASE. Copyright (C) IBM.






In lock-speak, all this means is that nothing leaks from the critical region that is protected by the primitive in question. A thread attempting to take a lock will synchronize/pair the load (ACQUIRE), for instance via Rmw (cmpxchg), when attempting to take the lock with the last store (RELEASE) when another thread is concurrently releasing the lock (for example, setting the counter to 0).





For v4.2, Will Deacon introduced more relaxed extensions of traditional atomic operations (including Rmw) which allow finer grained control over, what used to be, full barriers semantics on both sides of the instruction. This is also true for just about all atomic functions that return a value to the caller, ie: atomic_*_return(). As such weakly ordered architectures can make use of these -- currently only arm64 makes use of them, but efforts for PPC are being made.



      - *_relaxed: No ordering guarantees. This is similar to what we have already for the non-return atomics (e.g. atomic_add).
  
      - *_acquire: ACQUIRE semantics, similar to smp_load_acquire.
  
      - *_release: RELEASE semantics, similar to smp_store_release.



So we now have goodies such as atomic_cmpxchg_acquire() or atomic_add_return_relaxed(). Most recently, aiming for v4.4, I've ported all our locks to make use of these optimizations, which can save almost half the
amount of barriers in the kernel's locking code -- which is specially nice under low or regular contention scenarios,
where the fastpaths are exercised. There are plenty of other examples of real world code making use of acquire/release semantics. Mostly by using smp_load_acquire()/smp_store_release() other primitives  also use these semantics for common building blocks (as esoteric as they can get, ie RCU).

Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:
✏️ Information ergänzen
🛡️ Versioniert via CMS-Revisions-Engine (Freigabe-Queue für Gäste)

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität

Verwandte Story-Cluster & Quellen (Vektor-KI)

6 Cluster
19 Quellen
Bluetti Black Friday: Drei empfehlenswerte Powerstations günstiger
ifun.de vor 21 Min.
18 weitere Quellen
CNETvor 21 Std.I Test Air Fryers. Cuisinart’s Glass Model Is a Steal at $84 for Black Friday t3n.devor 1 Std.Black Friday: Diese 9 Fritzboxen, Repeater und Co. sind wirklich günstig Golem.devor 52 Min.Anzeige: Leises Rudergerät zum Black Friday günstig wie nie bei Amazon heise online Newsvor 41 Min.Black Friday: Bei Saugrobotern kräftig sparen – Topmodelle zum Tiefstpreis AppleInsider Newsvor 40 Min.Black Friday price war drops Apple's M6 MacBook Pro to $1,779 WinFuture Newsvor 1 Std.Black-Friday-Deal: Lymow One Plus, der Panzer unter den Mährobotern netzwelt.devor 2 Std.Xiaomi TV F Pro im Black-Friday-Check: Wie gut ist der Fernseher-Hit wirklich? netzwelt.devor 1 Std.Wer eine Nintendo Switch 2 sucht, sollte sich diese Black-Friday-Aktion bei congstar anschauen Computer Bildvor 1 Std.Black Friday: Die besten Girokonto-Deals PC-WELTvor 1 Std.Amazon Black Friday Woche am Dienstag: Die besten Technik-Deals im Überblick PC-WELTvor 1 Std.Fritzbox 7690 mit Wi-Fi 7 bei Amazon im Black-Friday-Angebot: Jetzt deutlich günstiger Latest from TechRadarvor 1 Std.Proton VPN Plus vs Surfshark One: which plan is the better Black Friday deal right now? Latest from TechRadarvor 1 Std.Black Friday Oura Ring deals: The best of the deals so far, picked by a wearable-tech expert CNETvor 6 JahrenOur Favorite Blenders of 2026 Are on Sale Ahead of Black Friday CNETvor 1 Std.Brighten Up Your Day by Saving 20% Off Flashlights With Olight’s Black Friday Sale CNETvor 1 Std.Live: Black Friday Deals Are Here. Shop Expert Picks Across Tech, Everyday Essentials and More at Up to 60% Off Golem.devor 1 Std.Anzeige: Logitech-Tastatur MX Keys S am Black Friday zum Sensationspreis auf Amazon PC-WELTvor 2 Std.Luminar zum Black Friday: KI-Bildbearbeitung für nur 79,20 Euro
17 Quellen
CVE-2026-133764 | Twig up to 3.31.0 Sandbox toString sandbox (EUVD-2026-133913)
VulDB Updates vor 51 Min.
16 weitere Quellen
VulDB Updatesvor 51 Min.CVE-2026-133763 | Symfony Twig up to 3.31.0 Sandbox toString sandbox (EUVD-2026-133912) VulDB Updatesvor 51 Min.CVE-2026-132270 | Significant-Gravitas AutoGPT up to 0.8.4 Autopilot authorization (EUVD-2026-133583) VulDB Updatesvor 51 Min.CVE-2026-136123 | Friendica up to 2026.05-1 ActivityPub compactProfile input validation (EUVD-2026-133909) VulDB Updatesvor 51 Min.CVE-2026-136124 | welovemedia ffmate up to 2.0.x wildcardReplacer argument injection (EUVD-2026-133908) VulDB Updatesvor 1 Std.CVE-2026-72522 | Libexpat up to 2.8.2 Unicode *_toUtf16 out-of-bounds (EUVD-2026-54990 / Nessus ID 385514) VulDB Updatesvor 1 Std.CVE-2026-133773 | Twig markdown-extra up to 3.31.0 HtmlConverter html_to_markdown options resource consumption (EUVD-2026-133922) VulDB Updatesvor 1 Std.CVE-2026-133772 | Twig up to 3.30.x Sandbox sandbox (EUVD-2026-133921) VulDB Updatesvor 1 Std.CVE-2026-133770 | Twig up to 3.31.0 Sandbox __construct sandbox (EUVD-2026-133919) VulDB Updatesvor 1 Std.CVE-2026-133769 | Symfony html-extra up to 3.31.0 Cva Cva::apply sandbox (EUVD-2026-133918) VulDB Updatesvor 1 Std.CVE-2026-133767 | Twig up to 3.31.0 Sandbox __toString sandbox (EUVD-2026-133916) VulDB Updatesvor 1 Std.CVE-2026-133766 | Twig up to 3.31.0 Sandbox toString sandbox (EUVD-2026-133915) VulDB Updatesvor 1 Std.CVE-2026-133765 | Symfony Twig up to 3.31.0 Sandbox sandbox (EUVD-2026-133914) VulDB Updatesvor 2 Std.CVE-2026-13137 | Hitachi Energy RTU500 CMU up to 13.9.1 User management/REST resolver/SPA-Bus buffer overflow (EUVD-2026-133827) VulDB Updatesvor 2 Std.CVE-2026-131717 | Liquid Web, StellarWP Event Tickets Plugin up to 5.31.1 on WordPress authorization (EUVD-2026-131354) VulDB Updatesvor 2 Std.CVE-2026-126605 | Proton Pass up to 1.21.0 Face ID App Lock improper authentication (EUVD-2026-133826) VulDB Updatesvor 2 Std.CVE-2026-103406 | Juniper Session Smart Conductor up to 7.0.4/7.1.6/7.2.2 AutomatedProvisioner os command injection (EUVD-2026-112215)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten acquire/release semantics in the kernel

Thematisch verwandte Begriffe: acquirerelease, semantics, kernel · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag