Repository navigation
Write a partly merged WCB line only when it must go - #368
Merged
Merged
Conversation
The WCB wrote its oldest line whenever the store buffers left the write port free for a cycle, so a loop that did any work between its stores sent each line in pieces. A line now goes when it is full, when a load needs it, when a store for another line needs its entry, when something must follow every older store (a barrier, an atomic, a drain, or a store to a device such as HTIF, which reads memory as soon as it is written), or once no store has merged into it for wcb_idle_cycles (16 by default).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The write-combining buffer wrote its oldest line whenever the store buffers left the L1D write port free for a cycle, so a loop doing any work between its stores sent each line in pieces: a stream that computes each doubleword it stores reached the L1D as 768 writes for 128 lines. That also stops write streaming from seeing whole-line writes.
A partly merged line now goes only when:
tohostis written and the bundled libc does not fence before it, so a device store waits until the WCB has written everything older;wcb_idle_cycles(new, default 16). No core documents this value; the default is not fitted to a measurement.Tests:
a_store_stream_reaches_the_l1d_a_whole_line_at_a_time: 128 line writes for 128 lines (768 under the old policy).an_unfenced_syscall_sees_the_stores_the_write_combining_buffer_held: an unfenced HTIFwriteprints what was stored; without the device-store wait the host reads a stale block and the program never exits.Locally: Rust and Python suites,
make accuracy(unchanged),make lockstep-ci858/858, riscv-tests onref linuxwith 4 harts 188/188, multicore smoke 120/120.