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: Serveurs Unix & Linux


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)

💬 Discussion communautaire et commentaires

🌐 Rejoindre le chat principal

Lancez la discussion dans le flux diffusé du Social Chat ou proposez ci-dessus une contribution experte via le formulaire de complément.

Briefing sécurité Gratuit · désabonnement en 1 clic

Intelligence Digest — gratuit

Chaque jour, les principales actualités sécurité · résiliable à tout moment

Évaluation communautaire & preuve sociale
⭐ Avis des lecteurs
–
Ø / 5.0
Pas encore d'évaluation des lecteurs
Cet article vous a-t-il été utile ?
0
Donner votre évaluation
Évaluation détaillée (facultatif)
Contenu & qualité
Source & fiabilité
Actualité

Groupes d’histoires apparentées & sources (IA vectorielle)

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

Auch interessante Nachrichten acquire/release semantics in the kernel

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

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

Laden...

Chargement des articles ...

Laden...

Chargement des vidéos ...

💬 Chargement des commentaires…
Sentinel CTI: ONLINE
Tirer pour actualiser
Widgets & Topics
Loading widgets…
Nächster Beitrag