O_DIRECT alignment: query the file, not a fixed block size
Published 2026-10-13 · Updated 2026-11-29
Query the target file, check which fields were actually returned, and keep alignment separate from durability. A missing result is not a zero-byte requirement. Historical 4096-byte and 512-byte examples are not defaults for every filesystem.
On this page19 sections
Read the mask before the numbers
Request STATX_DIOALIGN, available since Linux 6.1, then inspect stx_mask. Without that returned bit, the query did not establish the rule. With it, zero base fields mean unsupported direct I/O; positive fields describe buffer alignment and offset/segment-length alignment. Since Linux 6.14, STATX_DIO_READ_ALIGN can report a separate read limit. A reported zero retains the general rule; a positive value can relax read offsets and lengths, not memory alignment. [1]
| Case | Returned mask; M/O/R | Interpretation | Memory / write / read |
|---|---|---|---|
| No alignment result | 0x00 / 0 / not reported | unknown | not established |
| Reported unsupported | 0x20000 / 0 / not reported | unsupported | not established |
| General rule only | 0x20004096 / 512 / not reported | reported | 4096 / 512 / 512 |
| Read field reported as zero | 0x220004096 / 4096 / 0 | reported | 4096 / 4096 / 4096 |
| Less restrictive read offset | 0x220004096 / 4096 / 512 | reported | 4096 / 4096 / 512 |
| Contradictory reported fields | 0x20004096 / 0 / not reported | inconsistent | not established |
The table is generated from tested interpretation code. An inconsistent record is rejected, not repaired by guessing. This educational function does not issue I/O or validate an actual buffer. Download the example records and interpretation code.
Where 4096 and 512 came from
The older Linux examples in open(2) explain a historical change from filesystem block-size alignment to device logical-block alignment. They do not replace a per-file query. Misaligned operations can fail or fall back to buffering, depending on the filesystem and kernel. A successful call alone therefore does not identify the path used. [2]
| Rule | Linux version (as printed) | Alignment (bytes, as printed) | Operands | How to read the figure | Source |
|---|---|---|---|---|---|
| Linux 2.4 filesystem block size, most filesystems based on block devices | 2.4 | typically 4096 | file offset, length, and memory address of all I/O segments | Parenthetical filesystem block size in open(2) NOTES. Not a measured disk rate. | open(2) |
| Linux 2.6.0 relaxation of that same requirement | 2.6.0 | typically 512 | file offset, length, and memory address; the multiple is the logical block size of the block device | Parenthetical logical block size. Not a measured disk rate, and not a conversion of the 4096-byte row. | open(2) |
| stx_dio_mem_align when direct I/O is not supported on the file | 6.1 | 0 | user memory buffers for O_DIRECT | Only when STATX_DIOALIGN is returned: zero means unsupported, not unrestricted. | statx(2) |
| stx_dio_offset_align when direct I/O is not supported on the file | 6.1 | 0 | file offsets and I/O segment lengths for O_DIRECT | Only when STATX_DIOALIGN is returned: zero means unsupported. Both base alignment fields are zero or both nonzero. | statx(2) |
| stx_dio_read_offset_align if zero, field definition | 6.14 | 0 | file offsets and I/O segment lengths for direct I/O reads | Only when STATX_DIO_READ_ALIGN is returned: zero keeps the general offset/length rule. A smaller nonzero value affects reads, not memory alignment. | statx(2) |
Historical values are retained as reference, not current defaults. Interpret statx zero values only after checking the corresponding returned mask bit.
Bypassing the cache does not remove coherence work
Linux v6.17's iomap documentation describes flushing dirty cached data before direct reads and writes, and invalidating the page cache around direct writes. It also documents an internal fallback when invalidation cannot be completed. Bypassing the normal cached transfer is therefore not the same as never interacting with cached state. This describes iomap, not every filesystem implementation. [3]
O_DIRECT alone does not provide O_SYNC durability semantics. On NFS, it bypasses the client's page cache, not necessarily the server's. Avoid overlapping buffered/direct access and file mappings without a coherent access design. Outstanding direct I/O using private memory, including heap buffers, must complete before fork(); the manual documents shared-memory and MADV_DONTFORK exceptions. [2]
Related contracts deserve separate checks: NFS stability and flush/FUA, fsync error handling and atomic writes versus durability.
Client direct I/O does not choose the server cache path
On NFS, client O_DIRECT bypasses the client page cache; the flag is not sent to the server. Linux v7.2 documents separate, experimental NFSD read and write cache-mode settings. Record both sides when comparing I/O modes. These are implementation settings, not NFS protocol options. [2] [43]
The v7.2 debugfs controls apply across NFS versions, exports and NFSD network namespaces. Selecting DONTCACHE or DIRECT for reads disables splice-read eligibility; selecting BUFFERED afterwards does not re-enable it. Conversely, enabling splice reads forces BUFFERED. Record both the read mode and disable-splice-read before and after a comparison: restoring only the mode may leave a different configuration. Eligibility does not guarantee that every read uses splicing. [45]
- Userspace request:
preadv2()orpwritev2()withRWF_DONTCACHEreportsEOPNOTSUPPwhen the target does not support the flag. [6] - Server policy: NFSD's
DONTCACHEselection falls back to ordinary buffered I/O when the filesystem lacksFOP_DONTCACHE. In v7.2,nfsd_iter_read()andnfsd_vfs_write()add the drop-behind flag only when that capability is present. Other I/O failures remain possible. [44]
A configured mode is therefore not evidence of the executed cache path. Even with support, drop-behind remains best effort; it does not certify an empty cache or durable completion. This is a source comparison pinned to v7.2, not a feature-introduction date or a benchmark. [6] Compare the existing definitions of NFS, RWF_DONTCACHE and direct I/O.
Benchmark history matters too. Ellard and Seltzer's USENIX 2003 study used FreeBSD 4.6.2 and NFSv2/v3, not current Linux NFSD. Their cache-control procedure accounted for both client and server memory, and they showed how disk placement, queueing and transport choices could obscure the effect of a read-ahead change. In their sequential-read experiment, enlarging the history table removed the apparent need for the new heuristic. Those results do not rank today's cache modes; they show why a mode comparison needs a controlled baseline beyond its configuration label. [46]
A failed direct write can leave changed bytes
For Linux write() using direct I/O, an error does not establish that the attempted range is unchanged. Some data may already have been written. Treat the range as potentially inconsistent, not as proven corrupt: the error alone does not identify which bytes changed. [27, NOTES]
| Result | What it tells you | What remains unresolved |
|---|---|---|
| Positive short count | The call reports fewer transferred bytes than requested. | The remaining transfer and required synchronization. |
| -1 with errno | An error result is not a transferred-byte count; interpret errno and the failure stage separately. | The error alone does not show whether the attempted range changed. |
| Full requested count | The call reports the complete transfer. | O_DIRECT alone does not establish durable completion. |
A short-count retry must still satisfy the target's alignment requirements. An operation known to be rejected before submission is a different case; do not turn this warning into a claim that every invalid request damages data. For write(), EINTR is documented as interruption before any data is written. [27, RETURN VALUE and ERRORS] [2]
Why an error can hide transfer progress
In Linux v6.17, iomap_dio_bio_iter() increases dio->size before submitting a bio. Bio completion can record an error separately. iomap_dio_complete() starts from that error, invokes any filesystem completion hook, and uses the byte total only if the resulting status is zero. For this bio-completion path, multiple submitted bios do not become a user-visible partial-byte count merely because some completed. This is source inspection of iomap, not a fault-injection result or a claim about every filesystem. [28, submission and completion paths]
Recovery implication: retain the operation's intended offset, length and trusted payload, and stop dependent updates until the application's recovery protocol resolves the uncertain range. A later synchronization call is not a reconstruction of missing bytes. Where all-or-nothing overwrite semantics are required, examine the separate atomic-write contract and its eligibility conditions. The existing Direct I/O record carries the same error boundary.
One-pass buffered I/O is not direct I/O
A streaming scan can displace useful cached data without benefiting from reuse. The choice is not just ordinary buffering or O_DIRECT: Linux also exposes hints that change retention while keeping buffered transfers. Treat admission, reuse policy, eviction and durable completion as separate decisions.
The posix_fadvise API accepts a byte offset, byte length and one advice value. A zero length means all data after the offset, not an empty request. Its range need not already exist; this is advice, not a request to reserve storage or extend the file. Treat the names as expectations and the Linux policies below as implementation behavior, not universal cache outcomes. [5] [7]
POSIX_FADV_NOREUSE: since Linux 6.3, accesses can be discounted by page replacement. It was a no-op from 2.6.18 through 6.2. This is a reuse hint, not an immediate eviction request. [5]POSIX_FADV_DONTNEED: asks to release cached ranges. Unwritten dirty pages remain; it is not a substitute for synchronization. The API returns an error number directly, unlike calls that return -1 and seterrno. [5]RWF_DONTCACHE: available since Linux 6.14, requests best-effort drop-behind for newly instantiated cache content. Previously cached ranges are not pruned by this hint. Unsupported targets reportEOPNOTSUPP. This is still buffered I/O. [6]
The general DONTNEED advice is to align the range to pages: partial pages are normally retained. There is a useful implementation detail in Linux v6.14: generic_fadvise() also allows the final partial page when the inclusive range end equals the file's final byte. That exception does not guarantee eviction; filesystem overrides and concurrent access still matter. [7]
For RWF_DONTCACHE writes, starting writeback is not waiting for durable completion. Use the required synchronization contract separately. The v6.14 read path copies folios to the caller before attempting drop-behind; allocation and copying costs have not disappeared merely because retention is reduced. [6] [9]
A successful hint is not a cache-residency measurement. Nor does clearing the client's cache establish cold server or device caches. Linux's system-wide drop_caches does not free dirty objects and can impose substantial reloading costs; kernel documentation discourages routine use outside testing or debugging. Record exactly which cache was controlled, and avoid treating a cache-drop command as a performance optimization. [8]
Inference for experiment design: compare retention hints and direct I/O using identical data, reuse, memory pressure and completion requirements. Qian et al.'s FAST 2024 work motivates these controls, but did not evaluate the later Linux 6.14 flag. Its Lustre results cannot establish a speedup for RWF_DONTCACHE. [4]
Machine-readable definitions: NOREUSE, DONTNEED and RWF_DONTCACHE.
A range argument is not a private policy boundary
Linux documents POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL and POSIX_FADV_NORMAL as affecting the whole file through the advised handle, even when the caller supplies a short range. They change read policy, not the file's contents or durable state. [5]
In v6.14's generic implementation, the policy lives in struct file. A dup() alias shares that open file description; a separate open() creates another one. Separate policy state does not create a private page cache. [7], [2]
| Advice | Budget | RANDOM flag | NOREUSE flag |
|---|---|---|---|
| NORMAL | B | Cleared | Cleared |
| RANDOM | Kept | Set | Kept |
| SEQUENTIAL | 2 x B | Cleared | Kept |
| NOREUSE | Kept | Kept | Set |
Thus SEQUENTIAL does not undo an earlier NOREUSE hint, while NORMAL clears it. RANDOM does not itself zero the saved budget. Explicit WILLNEED still takes its own prefetch path; readahead() dispatches to that advice in this version. RANDOM is not a prohibition on all future reads or prefetch. [7], [22]
Who else uses the cached range?
A separate open() of the same regular file gives a reader separate open-file-description policy state, not a private page cache. In Linux v6.14, generic_fadvise(DONTNEED) targets the file mapping and page-index range; it does not select the handle that originally populated those pages. Eligible data already cached by another reader can therefore be considered for eviction. [7]
The same version also shows why drop-behind remains conditional: __filemap_get_folio() clears a folio's drop-behind mark on a lookup without FGP_DONTCACHE. The buffered-read cleanup path skips dirty or writeback folios and uses a nonblocking lock before attempting invalidation. This does not guarantee residency after a competing access. [9]
For a streaming scan alongside a latency-sensitive reader, choose between changing reuse treatment, attempting newly allocated-cache drop-behind and evicting a shared range. Record competing access and observe the resulting cache state; an accepted hint alone cannot demonstrate isolation or a cold-cache workload. Compare the RWF_DONTCACHE and DONTNEED contracts.
A historical case where less speculation helped
Plonka, Gupta and Carder studied RRD updates on Linux 2.6.9, ext2/ext3 and a 16 GB server. Reopening files discarded learned read-ahead state, repeatedly fetching blocks outside the small update working set. Their RANDOM-advised configuration supported roughly 320,000 RRD files within its operational target. [23, Method and Tools; Scalability]
This was a particular update workload, not evidence that RANDOM improves every reader. The authors explicitly left RRD fetch and graph performance insufficiently measured. Their separate buffering approach delayed updates and changed read visibility. Do not combine those outcomes into a flag-only speedup. This is a paper review, not a reproduction. [23]
Practical inference: record descriptor ownership and advice order when a library temporarily changes policy; NORMAL is not a saved-state restore. Compare the application's complete workload, including readers and memory pressure. Definitions: RANDOM, SEQUENTIAL and open file description.
Prefetch, NOWAIT and direct I/O answer different questions
POSIX_FADV_WILLNEED announces a future read. Linux starts page-cache prefetch, potentially reducing it under memory pressure; successful advice does not establish that the entire range is ready. [5] In v6.17, generic_fadvise() can even accept and ignore advice for DAX or a noop backing device. Filesystem overrides may differ. [13]
readahead() also requests cached data in advance. It preserves the file offset, rounds the range to pages and stops at EOF. A zero result means success, not zero bytes fetched or a count of ready bytes. It can block while reading filesystem metadata needed to locate blocks. [10]
RWF_NOWAIT instead changes a read attempt. It can return partial data; EAGAIN reports no progress when waiting would be necessary. [6] In Linux v6.17, a file without FMODE_NOWAIT support is rejected with EOPNOTSUPP, which is not a cache miss. [11]
NOWAIT is not NOIO. The v6.17 generic buffered-read path checks IOCB_NOIO separately and can initiate readahead before returning EAGAIN. A failed immediate read does not prove that storage stayed idle, and lock contention can also explain it. This is a pinned implementation observation, not a latency bound for every filesystem. [12]
| Result | Interpretation | Caller action |
|---|---|---|
| Positive byte count | Some data returned, possibly short | Consume only those bytes; advance buffers and an explicit offset accordingly. |
| -1 / EAGAIN | No progress now | Defer or use a deliberate fallback; do not count it as EOF. |
| -1 / EOPNOTSUPP | Unsupported operation or flag | Handle capability separately from temporary readiness. |
| Zero | Normally EOF for this nonempty request | Account for the documented Linux 5.9/5.10 premature-zero bug. |
Engineering inference: record advice results separately from actual read results, and include retry and fallback work when comparing performance. Prefetch completion, cache bypass and asynchronous submission are different questions; this review provides no speedup measurement. See io_uring completion semantics.
Definitions: WILLNEED, readahead and RWF_NOWAIT.
Which queue is being polled?
RWF_HIPRI permits completion polling for eligible direct I/O; RWF_NOWAIT instead controls whether a read waits for unavailable data or a lock. The flags answer different questions. A successful transfer with HIPRI is not proof that a polling path ran. [6]
| Control | Requested behavior |
|---|---|
| RWF_HIPRI | Permit completion polling for eligible direct I/O. |
| RWF_NOWAIT | Read without waiting for specified unavailable resources. |
| IORING_SETUP_IOPOLL | Poll storage completions; requires a supporting path. |
| IORING_SETUP_SQPOLL | Have a kernel thread check the submission queue. |
For the documented io_uring read/write opcodes, IOPOLL requires direct I/O plus filesystem and device support. SQPOLL alone does not select completion polling, and its thread can sleep and need a wakeup. Compare latency, throughput and total CPU use together; fewer submission syscalls do not establish a net improvement. [36]
Count the poller in the CPU budget. Didona et al.'s SYSTOR 2022 study used Linux 5.13, fio 3.28 and 4 KiB random reads on raw NVMe devices. In their single-drive experiment, the application and kernel submission poller competed when only one core was online; a second core removed that bottleneck. Their multi-drive tests also varied the CPU-to-drive ratio. This is evidence that thread placement belongs in a comparison, not a universal two-cores-per-drive rule or a result for current kernels, filesystem workloads or durable database writes. No benchmark was reproduced here. [37]
A concrete Linux v6.14 boundary
The VFS iterator path for preadv2() and pwritev2() calls init_sync_kiocb(). Its null completion callback makes is_sync_kiocb() true. In iomap_dio_submit_bio(), the HIPRI branch calls bio_set_polled() only for a nonsynchronous request. A synchronous request reaching this helper therefore cannot take that branch. This follows from the pinned source, not a measured device trace. [33] [34] [35]
The helper also permits filesystem-specific submission callbacks; this finding does not rule out every other polling mechanism or describe all kernels. Record the actual path and completion configuration before attributing a result to HIPRI. Completion detection also does not replace the operation's separate durability requirements. Definition: RWF_HIPRI.
The same invalid descriptor, different error channels
Do not reuse a single return-value check across these interfaces. posix_fadvise() reports failure as an error number in its return value; readahead() and preadv2() return -1 and set errno. Testing only for -1 can misclassify failed advice as success. [5], [10], [6]
Hesela ran all three calls with descriptor -1 and a nonempty one-byte range. On the recorded Linux/glibc host, advice returned EBADF, while both other calls returned -1 with errno equal to EBADF. All three checks passed. The saved advice errno was zero, but callers should use the returned error number, not infer success from errno.
This is one deterministic error-path check per interface, not a filesystem survey: no valid file was read, and it does not test cache residency, a valid NOWAIT read or prefetch speed. Reproduce with the C source and Python runner; the result JSON records the environment, compiler flags, actual returns and source hashes.
Why prefetch has a memory budget
Patterson and colleagues' SOSP 1995 paper treats prefetch buffers and cached reusable blocks as competing uses of memory. Its prefetch horizon depends on consumption rate and disk latency under an uncongested-disk model; requesting ever more future data is not automatically beneficial. [14, sections 3-4]
The evaluation used OSF/1 on a 150 MHz Alpha with 15 disks and a fixed 12 MB file cache. Six single-threaded, synchronous applications were tested from cold cache, with five runs per sequence. In the Davidson case, ordinary sequential readahead slightly beat prefetch-only TIP-1 because of overhead; TIP-2's informed caching reduced repeated reads. This separates reuse policy from prefetch. [14, sections 6-7.1]
The Postgres 4.2 join experiment also separates code restructuring from hints. Splitting the lookup loop improved index-cache locality and reduced elapsed time by about 20% without giving hints. TIP-1 hints then reduced time by up to 45% and 64% relative to the restructured, no-hint cases; the combined reductions of up to 55% and 75% use standard Postgres as their baseline. These percentages have different denominators and are not additive. A useful control therefore keeps the same precomputation and access order while withholding hints. This is a lesson from the historical experiment, not a measured benefit of Linux posix_fadvise(). [14, section 7.6 and Figure 13]
These are historical results, not measurements of Linux WILLNEED or modern SSDs. Hesela's experimental-design inference is to measure demand-read stalls, prefetched bytes actually consumed, displaced reusable data and competing workloads together. The paper was reviewed, not reproduced.
Prefetch depth must account for disk contention
Informed prefetching uses application disclosures, not just detected sequentiality. [PDIS 1994, sections 1-2] TIPTOE extends TIP-2's buffer allocator to account for upcoming disk overload. Deeper reads can reduce later stalls, but consume memory that could retain reusable data. [SIGMETRICS 1997, section 2]
Keep numerical summaries tied to their stated comparison. The abstract reports 7% lower execution time against LRU-SP. Table 2 instead gives the following ratio for LRU-SP/Forestall; its conversion is about 3.9%, not 7%. These summaries are not interchangeable. [Abstract and Table 2]
| Reported quantity | Value | Conversion |
|---|---|---|
| Elapsed time: LRU-SP/Forestall divided by TIPTOE | 1.041 | 100 × (1 - 1 / 1.041) = 3.9% reduction |
Table 2 uses geometric means over eleven selected application pairs. The simulation omits paging interference. This is source review, not a Linux or SSD benchmark. [Sections 4.3 and 5.2]
An accepted range is not a coverage receipt
In Linux v6.14, explicit prefetch is bounded before dispatch: min(requested_pages, max(io_pages, ra_pages)). The later 2 MiB chunking step is not the total-request limit. End-of-file clipping and incomplete filesystem submission still matter. This is a source-level budget, not measured completed I/O. [22]
The backing-device setting is not a universal ceiling either: SEQUENTIAL doubles the per-open budget, and a large demand read can use the larger io_pages allowance. [7], [22]
Wu and colleagues' OLS 2007 design distinguishes a large demand read, handled progressively, from the lookahead mark that starts the next prefetch. Sections 2.3-2.4 and 3.3 also explain why pages arriving early can be reclaimed before use. These historical mechanisms motivate measuring progress and timing separately; they do not establish a modern kernel's performance. [21]
Practical inference: do not label a file fully warmed from a zero advice return or the requested byte count. Retain the kernel, filesystem, descriptor policy, requested interval and subsequent observations. A successful demand read verifies delivered bytes; it does not reveal whether they were prefetched. Definitions: readahead and WILLNEED.
Address history is not cached payload
TaP tracks addresses separately from payloads. Its history can therefore survive without retaining old data merely to detect sequential streams. A history hit is not a data hit. The paper's cache-size target is its own achievable read-ahead hit rate for the given workload, not a universal latency optimum. Its comparisons include table memory in the competing cache budgets. [TaP, sections 3-4]
Li and Shen study a different layer: a Linux 2.6.10 prototype moves a prefetched page to the ordinary buffer cache on first access. Their separate prefetch pool and tail-of-stream reclamation policies address eviction before use; allocation adapts using miss-rate feedback. These are historical prototype experiments, not a description of today's kernel. [FAST 2005, sections 3-4]
Hesela's diagnostic inference: record three budgets separately. Two policies with equal payload capacity need not have equal total memory cost. Neither paper is reproduced here.
| Budget | Record | Do not infer |
|---|---|---|
| Address history | Entry count and metadata bytes | History membership does not certify resident payload. |
| Unused prefetched data | Resident bytes awaiting first demand | No demand yet does not prove a useless prediction. |
| Previously demanded data | Resident bytes and subsequent reuse | First use does not prove future reuse. |
Changing the layout changes the prefetch comparison
BORG changes placement, not just fetch timing. Its Linux prototype copies blocks into a dedicated HDD region and redirects requests through a persistent map. A sudden read-working-set shift can worsen performance. [BORG, sections 3-6]
Its week-long web-server replay served 1,137,234 requests to 256,017 distinct files. Against the unreorganized baseline, overall disk busy time fell by 14% with cumulative training and 18% with interval-only training, including reconfiguration. These are not application latency or throughput measurements. [BORG, section 6.2]
ALIS provides a useful contrast: heat clustering preserves locality among frequently accessed blocks, while run clustering arranges repeated sequences for sequential prefetch. Multiple copies require update or invalidation tracking. Its evaluation is trace-driven simulation, not BORG's Linux prototype. Defragmenting individual files alone does not capture cross-file access order. [ALIS, sections 2-4]
Timing matters too. ALIS infers dependencies from the last completed request; its block traces do not encode all application dependencies. The authors explain that replaying unchanged issue times would favor prefetching by leaving extra idle time and reducing scheduling opportunities. [ALIS, section 4.1]
Comparison rule: report training history, layout, cache state and reorganization cost separately. A shorter device-busy interval does not by itself establish a shorter application run. This is source synthesis: the author project page does not provide BORG code for reproducing the prototype.
Where a wrong prediction lands matters
DiskSeen predicts reads from nearby logical blocks, including across file boundaries. Its historical evaluation used Linux 2.6.11, ext3, 512 MB RAM and one 160 GB, 7200 rpm HDD. After sequential training, the adverse workload demanded four blocks per 20-block chunk. Unused prefetch raised execution time from 68.0 to 70.3 seconds with sequential chunk visits, but from 317 to 378 seconds with randomized visits. These are reported experimental cases, not a universal slowdown bound. [DiskSeen, sections 4.2 and 4.6]
Eviction does not erase prediction feedback
DiskSeen separates data residency from prediction history. While the block-table entry survives, an unused prefetch retains prefetched status after eviction. Another file-level prefetch candidate is rejected until on-demand access clears that status. Resident or busy blocks also suppress redundant prefetches; a demand request is not discarded as a bad prediction. [DiskSeen, section 3.2]
Diagnostic implication: an empty data cache is not necessarily an untrained predictor. Record history-table state separately when comparing cold runs. This historical mechanism is not a current Linux guarantee.
A short feedback history can miss thrashing
DiskSeen adapts the prefetch/cache memory split using two 2,048-entry eviction histories. That feedback missed thrashing in TPC-H Q17. The authors manually reduced the access-index gap T, which limits candidate history trails; it is not elapsed time. [DiskSeen, sections 3.5 and 4.3]
| Access-index gap T | Increase |
|---|---|
| 2,048 | 10% |
| 256, manually retuned | 2.6% |
The retuned run still regressed. Adaptive memory allocation did not imply adaptive throttling. These are the paper's historical measurements, not a Hesela replication.
Diagnostic implication: absence of hits in a bounded history does not prove absence of reuse outside it. Retain the history capacity and eviction count alongside the hit count. Compare prediction, memory allocation and throttling separately; a successful retune identifies sensitivity, not a universally optimal setting.
Li and Shen address a different decision: which unused prefetched pages to reclaim under memory contention. Their experiments hold the prediction strategy separate from memory management and compare reclamation policies. Better prediction and better retention therefore need separate controls. [FAST 2005, sections 3 and 4.2]
Hesela's diagnostic inference: report useful bytes alongside demand stall time, extra device work and memory cost. A prediction hit rate alone cannot identify which resource caused a regression. The following comparison plan is guidance, not an executed benchmark.
| Change | Hold or record |
|---|---|
| Prediction policy | Demand trace, block layout, device and total memory budget. |
| Reclamation policy | Prefetch candidates and their arrival times, then eviction before use. |
| Repeat run | Payload residency and predictor history as separate initial states. |
The existing memory-budget checklist and submission/completion/use diagnostics cover complementary measurements. This source review adds no hardware results.
Fetch size and trigger timing are separate choices
AMP distinguishes batch size from trigger distance: how much to fetch versus how early to start. Its prefetch wastage means eviction before use; pollution means displacing more valuable cached data. A correct prediction can therefore still waste I/O. [20, sections II-III]
Its steady-stream analysis assumes a shared LRU-based cache. Experiments used five SCSI disks on Linux 2.6.11; SPC1-Read omitted writes. These results do not establish modern Linux or SSD performance. [20, sections III-VI]
Wu and colleagues' Linux readahead paper describes demand-miss and lookahead-mark triggers for its proposed on-demand policy. Cached data can trigger another read before a miss occurs. This historical policy discussion is distinct from the blocking behavior of the readahead() syscall above. [21, sections 2.3-3.1]
For an investigation, record three events separately: prefetch submission, completion and first demand access. Also record eviction if it occurs first. A request submitted before demand is not necessarily ready before demand. The following is Hesela's diagnostic checklist, not measured results.
| Question | Evidence to retain | Interpretation limit |
|---|---|---|
| Did useful data arrive late? | Completion time relative to demand; blocked demand time. | Earlier submission alone does not prove that the stall disappeared. |
| Was fetched data evicted unused? | Bytes completed, then evicted before first demand; observation-window boundaries. | Data still resident at the end is unresolved, not automatically wasted. |
| Did another workload lose useful cache space? | Victim identities and later demands; a comparable run with prefetch reduced or disabled. | An unused prefetch count alone cannot quantify harm to the other workload. |
When reporting a fraction, state whether its denominator is submitted bytes, completed bytes or admitted cache pages. Do not mix these populations or silently count outstanding requests as completed. Retain per-stream results: an aggregate can hide which reader paid the cost. Definition: prefetch trigger distance.
Residency is not a cache-hit promise
mincore() reports a mapped range in page-sized units. Read only the low bit of each byte, check for -1 and errno, and treat success as a snapshot: unlocked pages may change before the call returns. It does not reserve data for the next read. [15]
There is a less obvious limitation. Linux v6.17 checks inode ownership/capability or file write permission before disclosing file-cache residency. If that check fails, it fills the result with ones. Read-only access alone is insufficient; a read-only descriptor for a file owned by the caller is a different case. All ones can be a privacy-preserving answer, not a fully warm file. This is a pinned source observation, not a claim about every kernel. [16]
Gruss et al.'s CCS 2019 paper explains the security motivation: shared file-cache state exposed activity across process boundaries. Its Linux threat model required readable target files and a shared cache; its local measurements and remote timing channel are distinct experiments. Section 9 discusses restricting disclosure, not making every cache side channel disappear. [18]
Neela et al. (NDSS 2026) revisit alternative observers. Crucially, their artifact appendix says the cachestat cross-user path was mitigated in February 2025 and distinguishes it from other mechanisms. A paper's publication year is not its tested patch state. Neither paper is reproduced here, and no attack tooling was run. [19, section III-D and appendix A]
Five fresh files, three snapshots each
Hesela created five separate, self-owned 32768-byte temporary files on ext4, using Linux 6.8.0-146-generic. Each contains 8 pages of 4096 bytes. After writing nonzero data and calling fdatasync(), the probe created an untouched private mapping. It then sampled residency, requested range-only DONTNEED, sampled again, read one byte using pread(), and sampled a third time.
| Run | Write + sync | Advice | 1-byte read | PTEs |
|---|---|---|---|---|
| 1 | 8 | 0 | 4 | 0 |
| 2 | 8 | 0 | 4 | 0 |
| 3 | 8 | 0 | 4 | 0 |
| 4 | 8 | 0 | 4 | 0 |
| 5 | 8 | 0 | 4 | 0 |
Here, all five files showed 8, then 0, then 4 resident pages. The mapping's present bits remained zero: cached file data and this process's installed page-table entries are different observations. The latter uses bit 63 from /proc/self/pagemap. [17] Four cached pages after a one-byte read also show why resident-page counts are not demand-byte counts. They do not identify physical-device reads or establish a universal readahead size.
These are sequential snapshots, not an atomic joint measurement. The test did not measure latency, trace storage I/O, clear system-wide caches or exercise the permission fallback. Eviction and prefetch outcomes may differ on another run. The unaligned address check returned EINVAL in all five repetitions; its output vector was discarded. No performance estimate or confidence interval is inferred from these controlled repetitions.
Reproduce from the Python source; the recorded observations include environment details and the source hash. The method and command describe scope and cleanup. Definition: mincore.
A resident private copy can outlive the cached file page
A MAP_PRIVATE write changes a private copy, not the file. Linux v6.17's mincore_pte_range() reports one for a present page-table entry; an absent entry in a file mapping instead leads to a file-cache lookup. Consequently, two mappings of one file offset can report different residency after copy-on-write. [29] [16]
We checked this with 5 separate one-page files and repeated the complete capture once on Linux 6.8.0-147-generic. Each 4096-byte file initially contained A bytes. After fsync(), the probe changed the first byte through a private mapping to B and locked that private page. It requested file-range POSIX_FADV_DONTNEED, then queried both that mapping and a second, untouched mapping before reading either byte or rereading the file.
| Trial | Private copy | Untouched mapping | After reading untouched mapping |
|---|---|---|---|
| 1 | 1 | 0 | 1 |
| 2 | 1 | 0 | 1 |
| 3 | 1 | 0 | 1 |
| 4 | 1 | 0 | 1 |
| 5 | 1 | 0 | 1 |
Every trial retained B in the private copy while the other mapping and pread() returned A. Unlocking the private page and applying MADV_DONTNEED to that mapping restored A on its next access. This is a content-identity control: file-cache advice and discarding a private mapping's changes act on different objects.
For a file-cache probe, record how the mapping was used. A modified private mapping is not interchangeable with an untouched observer. File-range advice is best effort; fresh-map eviction need not repeat on another host. The recorded filesystem magic identifies the ext family, not its version. These are bounded API observations, not latency, physical-I/O, durability or attack measurements. Gruss et al.'s discussion of shared unmodified pages provides context, not a replication claim. [18, section 2.2]
Download the method, C probe, runner, first capture and repeat capture. Source hashes, compiler, kernel and all byte controls are retained.
A workload-dependent result from FAST 2024
Non-overlapping writes can still contend. Qian et al. explain that the IO500 workload's 47,008-byte strided writes occupy separate byte ranges but require page-aligned client locks, which can overlap. Their Lustre direct-I/O path uses server-side locking to reduce callback traffic; that is a filesystem mechanism, not a guarantee from the O_DIRECT flag alone. Record both application byte ranges and coherence granularity when interpreting shared-file results. This is distinct from two readers sharing a local page cache. [4, sections 2.3 and 3.1]
Qian and colleagues implemented adaptive I/O selection in Lustre, using request size, lock contention, memory pressure and reuse. Their evaluation used 32 client nodes, eight storage targets and Lustre 2.15.58, alongside other filesystems and application workloads. Their unaligned-I/O path could allocate and copy into aligned buffers: direct I/O was not necessarily zero-copy. [4, sections 3.1-3.2 and 4]
This is evidence for conditional mode selection, not a universal speedup from adding O_DIRECT. Several experiments combine client switching with server write-back, delayed allocation or batching. Those interventions must not be attributed to the flag alone. The artifact appendix provides setup guidance but explicitly does not offer a fully automatic functional reproduction. Hesela reviewed the paper, not reproduced its cluster. [4, section 4 and appendix A]
A buffered interface can hide a different write path
WSBuffer, presented at FAST 2026, illustrates why an application's buffered interface does not fully describe the internal transfer path. Its design separates read caching from write buffering. The interesting distinction is when missing bytes are fetched: later writes can fill a scrap-page before the flusher visits it, avoiding the fill read. Otherwise, missing data must still be fetched. [24, sections 3.1-3.4]
Here, alignment means the scrap-page data zone, illustrated as 256 KB, not a 4 KB memory page or an application's O_DIRECT contract. The paper also reports slightly lower throughput than XFS for read-heavy Webproxy with sufficient memory and flushing disabled: reads may search both buffer indexes. Read caching alone does not guarantee unchanged read performance. [24, sections 3.3 and 4.3.1]
Count fragments as well as bytes
The default 128-byte header reserves 15 entries for data segments, alongside a separate valid-byte counter. The allocator groups 32 headers and 32 data zones. These are different resource limits: a small amount of scattered data can consume many descriptors. [24, section 3.2]
| Written positions | Valid bytes | Runs |
|---|---|---|
| Adjacent bytes 0 through 15 | 16 | 1 |
| Every other byte 0 through 30 | 16 | 16 |
Both histories cover 16 distinct bytes. Adjacent writes coalesce into one run; separated bytes need sixteen. Rewriting a covered byte adds neither coverage nor a new run. Sixteen runs cannot fit into fifteen one-run descriptors without some additional action or representation.
The paper reports fewer than 15 entries in more than 95% of its evaluated cases; that observation is not an overflow policy. Section 3.2 does not establish which fallback handles a workload exceeding the default entry capacity. A reproduction should record segment occupancy and confirm that path in the implementation before attributing a slowdown to SSD bandwidth. [24, section 3.2]
OTflush uses outstanding write bytes as a coarse SSD-busyness signal. Its Bcount rises on submission and falls on completion. Bytes in flight are neither a bandwidth rate nor a latency measurement; the default threshold belongs to the evaluated setup, not a universal saturation rule. [24, section 3.4]
Compare this with Qian et al.'s Lustre approach: request size, memory pressure and lock contention influence mode selection. A local write-path redesign and a distributed mode-selection policy answer different questions. Their reported gains cannot be combined into a common speedup for switching on O_DIRECT. [4]
Ordinary Linux writeback controls need equally careful interpretation. dirty_expire_centisecs establishes when dirty data becomes eligible for writeout; dirty_writeback_centisecs controls periodic wakeups. Neither is a durable-completion deadline. Disabling periodic wakeups is not disabling all writeback. Use and check the required synchronization operation separately. [25] [26]
Hesela's comparison checklist: record the kernel, filesystem, memory budget, cache state, request alignment and synchronization boundary; report foreground call latency separately from end-to-end completion. Treat a background read or flush as deferred work until the measured boundary includes it. This is methodological guidance, not a new benchmark or a reproduction of either paper.
Research identity and evaluation scope: WSBuffer. API background: buffered I/O.
What to record before comparing I/O modes
Hesela's review checklist separates four questions that a single throughput number cannot answer:
- Eligibility: retain the kernel, filesystem, mount and file context, requested and returned masks, and the alignment fields.
- Execution: record buffer addresses, offsets, segment lengths, errors, short transfers and evidence of fallback.
- Completion: make the synchronization and crash-recovery requirements identical before comparing rates.
- Workload: record cache state, reuse, memory pressure, concurrency, shared-file access, request sizes and server policy.
Definitions: direct I/O, direct-I/O alignment, buffered I/O and page cache.
Method
Primary-source review of Linux open(2), statx(2), Linux v6.17 iomap documentation and Qian et al. (FAST 2024). Six invented statx records are interpreted by tested code during the build. Historical byte figures below are documentation examples, not device measurements. The 15 October extension reviews Linux man-pages 6.19 and pinned Linux v6.14 cache-advice code; it adds no performance measurements. The 17 October supplement reviews prefetch and NOWAIT return semantics against Linux man-pages 6.19 and Linux v6.17 source; its caller-decision table is documentation-based, not an experiment. A three-call invalid-descriptor probe was executed on one Linux/glibc host; its environment and source hashes are published separately. Patterson et al. (SOSP 1995) is reviewed as historical prefetch/caching evidence, not reproduced. The cache-residency supplement reviews mincore against Linux v6.17, selected full-text sections of Gruss et al. (CCS 2019) and Neela et al. (NDSS 2026), and five fresh-file observations on one Linux 6.8 host. This is an API demonstration, not a replication of either security paper. The 18 October supplement reviews AMP (FAST 2007) and Linux readahead (OLS 2007), distinguishing shared-cache eviction, prefetch timing and observation-window limits. It adds diagnostic guidance, not measurements or a replication. The 23 October supplement traces generic Linux v6.14 RANDOM/SEQUENTIAL/NORMAL/NOREUSE state changes and explicit prefetch dispatch, and reviews Plonka, Gupta and Carder (LISA 2007). The transition table is source-derived, not a kernel execution or performance measurement. The 5 November supplement reviews WSBuffer (FAST 2026) and versioned Linux writeback controls; no prototype or performance results are reproduced. The 8 November correction distinguishes explicit-prefetch bounds from per-open policy and progressive demand reads using Linux v6.14 and Wu et al. (OLS 2007); no new native measurements. The direct-write error supplement reviews Linux man-pages 6.19 and Linux v6.17 iomap submission/completion source. Its outcome table is API guidance, not a fault-injection experiment or a measurement of persisted bytes. The 9 November prefetch-history supplement reviews TaP (FAST 2008, sections 3-4) and Li and Shen (FAST 2005, sections 3-4). The memory-accounting table is diagnostic synthesis, not a replication or measured performance comparison. The DiskSeen supplement reviews USENIX ATC 2007, sections 2-4, and compares its scope with Li and Shen. Reported timings are source results, not Hesela measurements. The 10 November polling supplement traces synchronous VFS initialization and iomap BIO submission in Linux v6.14, and contrasts liburing completion/submission polling. It is source inspection, not a polling benchmark. The CPU-budget context reviews Didona et al. (SYSTOR 2022), sections 3-4; no results were reproduced. The BORG/ALIS supplement is a historical primary-source comparison, not a new performance experiment. The informed-prefetch supplement reviews PDIS 1994 and SIGMETRICS 1997, distinguishing their mechanisms and numerical summaries without replaying the simulator. The 26 November follow-up reviews DiskSeen section 3.2 feedback; it adds no measurements. The 28 November WSBuffer follow-up distinguishes valid-byte coverage from segment-descriptor demand. Its two 16-byte histories are constructed examples, calculated from interval unions and checked against byte-set enumeration; no prototype overflow behavior is inferred. The 28 November NFSD supplement compares Linux v7.2 server policy with userspace API semantics; no NFS server, cache-residency or performance experiment was run. The 29 November supplement reviews Ellard and Seltzer (USENIX 2003), sections 4-5 and 9, as historical benchmark methodology; no performance results were reproduced.
Limits
No filesystem benchmark, statx probe, hardware experiment or replication of the Lustre study was performed. Reported alignment is not proof that a particular operation used the direct path, was atomic or became durable.
Primary sources
- Linux man-pages: statx(2), returned masks and direct-I/O alignment fields. Reviewed 2026-10-14.
- Linux man-pages: open(2), O_DIRECT flag and NOTES. Reviewed 2026-10-14.
- Linux v6.17: iomap supported file operations, sections 2.2.1-2.2.3. Reviewed 2026-10-14.
- Yingjin Qian et al. Combining Buffered I/O and Direct I/O in Distributed File Systems. FAST 2024, pp. 17-33; sections 3-4 and artifact appendix. Reviewed 2026-10-14.
- Linux man-pages 6.19: posix_fadvise(2), advice semantics and return values. Reviewed 2026-10-15.
- Linux man-pages 6.19: readv(2), RWF_DONTCACHE and RWF_DSYNC/RWF_SYNC. Reviewed 2026-10-15.
- Linux v6.14 mm/fadvise.c: generic_fadvise, including the end-of-file partial-page exception. Reviewed 2026-10-15.
- Linux v6.14 VM documentation: drop_caches, dirty objects and performance costs. Reviewed 2026-10-15.
- Linux v6.14 mm/filemap.c: filemap_read and drop-behind read completion. Reviewed 2026-10-15.
- Linux man-pages 6.19: readahead(2), ranges, return values and metadata blocking Reviewed 2026-10-17.
- Linux v6.17: kiocb_set_rw_flags and FMODE_NOWAIT Reviewed 2026-10-17.
- Linux v6.17: filemap_get_pages and filemap_readahead Reviewed 2026-10-17.
- Linux v6.17: generic_fadvise and filesystem-specific dispatch Reviewed 2026-10-17.
- R. Hugo Patterson et al. Informed Prefetching and Caching. SOSP 1995, pp. 79-95; sections 3-4 and 6-7.1. Reviewed 2026-10-17.
- Linux man-pages 6.19: mincore(2), residency snapshots and return values. Reviewed 2026-10-17.
- Linux v6.17 mm/mincore.c: can_do_mincore, do_mincore and page-cache lookup. Reviewed 2026-10-17.
- Linux v6.17: Examining Process Page Tables, pagemap present bit. Reviewed 2026-10-17.
- Daniel Gruss et al. Page Cache Attacks. CCS 2019. DOI 10.1145/3319535.3339809; sections 3, 5, 6.1, 7.1, 8 and 9. Reviewed 2026-10-17.
- Sudheendra Raghav Neela et al. Eviction Notice: Reviving and Advancing Page Cache Attacks. DOI 10.14722/ndss.2026.240006. Reviewed 2026-10-17.
- Binny S. Gill and Luis Angel D. Bathen. AMP: Adaptive Multi-stream Prefetching in a Shared Cache. FAST 2007, pp. 185-198; sections II-VI. Reviewed 2026-10-18.
- Fengguang Wu, Hongsheng Xi, Jun Li and Nanhai Zou. Linux readahead: less tricks for more. Linux Symposium 2007, volume two, pp. 273-284; sections 2.3-3.1. Reviewed 2026-11-08.
- Linux v6.14 mm/readahead.c: initialization, force_page_cache_ra, ractl_max_pages and syscall dispatch. Reviewed 2026-11-08.
- David Plonka, Archit Gupta and Dale Carder. Application Buffer-Cache Management for Performance: Running the World's Largest MRTG. LISA 2007, pp. 63-78. Reviewed 2026-10-23.
- Yekang Zhan et al. Rearchitecting Buffered I/O in the Era of High-Bandwidth SSDs. FAST 2026, pp. 579-595; sections 3.1-3.6 and 4.1. Reviewed 2026-11-28.
- Linux v6.16 VM sysctl documentation: dirty_expire_centisecs and dirty_writeback_centisecs Reviewed 2026-11-05.
- Linux man-pages: fsync(2), completion and errors Reviewed 2026-11-05.
- Linux man-pages 6.19: write(2), return values and direct-I/O error warning Reviewed 2026-11-08.
- Linux v6.17: iomap direct-I/O submission, bio error collection and completion Reviewed 2026-11-08.
- Linux man-pages 6.19: mmap(2), MAP_PRIVATE copy-on-write semantics Reviewed 2026-11-09.
- Mingju Li, Elizabeth Varki, Swapnil Bhatia and Arif Merchant. TaP: Table-based Prefetching for Storage Caches. FAST 2008, pp. 81-96; sections 3-4. Reviewed 2026-11-09.
- Chuanpeng Li and Kai Shen. Managing Prefetch Memory for Data-Intensive Online Servers. FAST 2005, pp. 253-266; sections 3-4. Reviewed 2026-11-09.
- Ding et al. DiskSeen: Exploiting Disk Layout and Access History to Enhance I/O Prefetch. USENIX ATC 2007, pp. 261-274; sections 2-4. Reviewed 2026-11-28.
- Linux v6.14: do_iter_readv_writev and preadv2/pwritev2 dispatch Reviewed 2026-11-10.
- Linux v6.14: init_sync_kiocb, is_sync_kiocb and kiocb_set_rw_flags Reviewed 2026-11-10.
- Linux v6.14: iomap_dio_submit_bio polling eligibility Reviewed 2026-11-10.
- liburing: io_uring_setup(2), IOPOLL and SQPOLL Reviewed 2026-11-10.
- Didona et al., Understanding Modern Storage APIs, SYSTOR 2022, sections 3.1-3.3 and 4 Reviewed 2026-11-10.
- Bhadkamkar et al. BORG: Block-reORGanization for Self-optimizing Storage Systems. FAST 2009, sections 3-6 and 9. Reviewed 2026-11-13.
- Hsu, Smith and Young. The Automatic Improvement of Locality in Storage Systems. UCB/CSD-03-1264, July 2003, sections 2-4 and 6. Reviewed 2026-11-13.
- FIU Systems Research Laboratory: BORG project, Code and Traces. Reviewed 2026-11-13.
- Patterson and Gibson. Exposing I/O Concurrency with Informed Prefetching. PDIS 1994, sections 1-2. Reviewed 2026-11-14.
- Tomkins, Patterson and Gibson. Informed Multi-Process Prefetching and Caching. SIGMETRICS 1997, sections 2-5 and Table 2. Reviewed 2026-11-14.
- Linux v7.2 NFSD IO MODES: experimental server read/write policy and DONTCACHE fallback. Reviewed 2026-11-28.
- Linux v7.2 fs/nfsd/vfs.c: nfsd_iter_read and nfsd_vfs_write capability checks. Reviewed 2026-11-28.
- Linux v7.2 fs/nfsd/debugfs.c: global cache controls and coupled read-mode/splice setters. Reviewed 2026-11-28.
- Daniel Ellard and Margo Seltzer. NFS Tricks and Benchmarking Traps. USENIX 2003 FREENIX, pp. 101-114, sections 4-5 and 9. Reviewed 2026-11-29.