L2 cache behavior during RMW operations?

FAQ, getting help, user experience about PrimoCache
Post Reply
hklvette
Level 1
Level 1
Posts: 2
Joined: Sat Jan 02, 2021 2:14 am

L2 cache behavior during RMW operations?

Post by hklvette »

I haven't seen this addressed anywhere else (might no be searching for the right thing), so here goes...

Setup:
No L1 cache
SSD as L2 read-only cache

Scenario:
Let's say that the blocks of "ABC.exe" are stored in the L2 cache. Something comes along and modifies the contents of ABC.exe, then stores the changes to disk. Assuming no interaction, the cached copy is now out-of-sync with the master. Does PrimoCache 1) Delete ABC.exe's blocks in L2 cache and re-gather, or 2) Copy the changes to L2 cache as they're being written to disk?

I ask because I had a recent automatic update break (I did have L1 and defer-write active, so there's that), and it took about a week to clean up the mess. I've since set the L2 cache to "volatile" and disabled write caching to force Windows to boot from the disk each time out of fear that sometimes the L2 cache isn't fully synchronized at "controlled" shutdown with what's on the disk (or defer-write buffer). Normal restarts and shutdown/reboot haven't posed a problem, so it seems related to having a large number of write or RMW operations close to shutdown.

Thanks!
InquiringMind
Level SS
Level SS
Posts: 471
Joined: Wed Oct 06, 2010 11:10 pm

Re: L2 cache behavior during RMW operations?

Post by InquiringMind »

hklvette wrote: Sun Jul 25, 2021 1:41 am ...Something comes along and modifies the contents of ABC.exe, then stores the changes to disk. Assuming no interaction, the cached copy is now out-of-sync with the master...
Even in "read only" mode, writes still go through the PrimoCache driver so it can detect (and update) its L2 cached copy of ABC.exe. The only time that an inconsistency can occur is if ABC.exe was modified while the disk partition was offline (e.g. if you accessed it using another Windows system without PrimoCache). See PrimoCache Terminology: Level-2 Cache for more details on this.

Windows updates can break for a number of reasons, and a close look at your Event Log may provide more information on what went wrong. However unless you used a corrupted volume for your L2 cache - or encountered a power outage or BSOD while running L1 with write-defer enabled, it's unlikely that PrimoCache would have contributed to it.
Post Reply