tools/memory-model/litmus-tests/dep+plain.litmus
Source file repositories/reference/linux-study-clean/tools/memory-model/litmus-tests/dep+plain.litmus
File Facts
- System
- Linux kernel
- Corpus path
tools/memory-model/litmus-tests/dep+plain.litmus- Extension
.litmus- Size
- 628 bytes
- Lines
- 32
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- 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 P0
Annotated Snippet
C dep+plain
(*
* Result: Never
*
* This litmus test demonstrates that in LKMM, plain accesses
* carry dependencies much like accesses to registers:
* The data stored to *z1 and *z2 by P0() originates from P0()'s
* READ_ONCE(), and therefore using that data to compute the
* conditional of P0()'s if-statement creates a control dependency
* from that READ_ONCE() to P0()'s WRITE_ONCE().
*)
{}
P0(int *x, int *y, int *z1, int *z2)
{
int a = READ_ONCE(*x);
*z1 = a;
*z2 = *z1;
if (*z2 == 1)
WRITE_ONCE(*y, 1);
}
P1(int *x, int *y)
{
int r = smp_load_acquire(y);
smp_store_release(x, r);
}
exists (x=1 /\ y=1)
Annotation
- Detected declarations: `function P0`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.