paulmckrcu/perfbook

[whymb] Missing writeback

Closed this issue · 1 comments

Before CPU0 can mark its cache line as "shared", the line must be written back to main memory to prevent data loss. It is worth mentioning here as long as we are concerned with main memory at all.

\item CPU~0 receives the ``read'' message, and transmits the
cache line containing the now-updated value of ``b''
to CPU~1, also marking the line as ``shared'' in its own cache.
\item CPU~1 receives the cache line containing ``b'' and installs
it in its cache.

\item CPU~0 receives the ``acknowledgement'' message, and puts
the cache line containing ``b'' into the ``exclusive'' state.
CPU~0 now stores the new value of ``b'' into the cache line.
\item CPU~0 receives the ``read'' message, and transmits the
cache line containing the new value of ``b''
to CPU~1.
It also marks its own copy of this cache line as ``shared''.

Good point, thank you!

This is addressed by commit e68dcb9 ("appendix/whymb: Add QQ on cachelines in dirty shared state") with your Reported-by.