Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-1.litmus
Source file repositories/reference/linux-study-clean/Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-1.litmus
File Facts
- System
- Linux kernel
- Corpus path
Documentation/litmus-tests/atomic/cmpxchg-fail-unordered-1.litmus- Extension
.litmus- Size
- 498 bytes
- Lines
- 35
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: Documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function cmpxchg
Annotated Snippet
C cmpxchg-fail-unordered-1
(*
* Result: Sometimes
*
* Demonstrate that a failing cmpxchg() operation does not act as a
* full barrier. (In contrast, a successful cmpxchg() does act as a
* full barrier.)
*)
{}
P0(int *x, int *y, int *z)
{
int r0;
int r1;
WRITE_ONCE(*x, 1);
r1 = cmpxchg(z, 1, 0);
r0 = READ_ONCE(*y);
}
P1(int *x, int *y, int *z)
{
int r0;
int r1;
WRITE_ONCE(*y, 1);
r1 = cmpxchg(z, 1, 0);
r0 = READ_ONCE(*x);
}
locations[0:r1;1:r1]
exists (0:r0=0 /\ 1:r0=0)
Annotation
- Detected declarations: `function cmpxchg`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.