noshutdown wrote on 2021-08-01, 09:13:
ok guyz, isn't that just the difference between write through and write back?
i would rather stick to WT because while WB is a few percents faster, i want larger cacheable range as i am stuffing 32mb into it to run win95 and quake2.
I like to call them "read-only" and "read-write" caching. You can think of it as different philosophies of how to approach the issue of "slow" DRAM becoming out of sync compared to the cache RAM.
With write-back, if the CPU writes to a location that happens to already be in the cache, DRAM is allowed to become out of date and syncing it with the cache is delayed as long as possible. So if a memory location is being used as a spillover location to hold a register value in a tight loop, etc., this could avoid a lot of needless updates to memory. On the other hand, it needs additional logic as, if a device like a floppy controller wants to read directly from memory without going through the CPU, the chipset has to intercept this access and make sure there isn't yet-to-be-written-back, aka dirty, data still sitting in the cache before allowing this access.
Write-through is simpler and just says not to let this happen. When reading memory, the cache will speed up accesses if information is already there, but when writing it, both the cache and DRAM get updated right-there-and-then. That means that memory reads are sped up by the cache, but memory writes are not. This means the only special case is when the floppy controller writes to memory, that part of the cache has to be invalidated so the CPU is forced to go to DRAM to read that data rather than getting out of date information from cache.
Because DRAM can't be out of sync with write-through, you don't need a "dirty" bit to track the fact it has become out of sync, and that is why switching to it doubles your cacheable area for those caches that rob the dirty bit from the tag RAM.
Because L1 is much faster than L2, the benefit of write-back is higher for L1, and I know there are several members who run write-back L1 and write-through L2 to maximize their cacheable area.
Are you sure you want to run Windows 95 and Quake(!) on a 386?