Writeback vs writethrough cache

I was fixing a PC with a fairly late 486DX2-66 motherboard in it. In checking it out, I found an interesting setting in its BIOS: I can use its L2 cache as either writeback or writethrough. But what’s the difference? What are the pros and cons of writeback vs writethrough cache?

Writeback is faster but was harder to implement than writethrough, so not all systems support it. If it’s available and your software doesn’t malfunction, use write-back.

Writethrough cache

Writeback vs writethrough cache
You usually have to use a utility like CHKCPU to see what cache capabilities a given 486 has, then enable Writeback mode in the BIOS if the motherboard supports it. Writeback vs writethrough makes a difference, if your system supports it.

Both writethrough and writeback are forms of a memory cache. Writethrough cache writes to memory immediately. Essentially all it’s doing is relieving the processor of the work so it can get on with other things. It’s simple and naive, but it ensures the cache and main memory always contain the same data.

On early 486s, the L1 cache is always write-through. The same is true of early 486 motherboards with L2 cache.

Writeback cache

Writeback cache is lazier. It waits as long as it can before writing to the main memory. This means if you repeatedly write to the same area of memory and it fits in the cache, the cache can eliminate redundant updates. Skipping those redundant updates improves performance significantly. In some cases, it can give you a 20% performance boost.

Only the later P24D versions of the Intel 486DX2 and the DX4 support write-back from the onboard L1 cache. Later AMD and Cyrix 486 CPUs also gained write-back capability. Not all 486 motherboards may be smart enough to disable this option on chips that don’t support it. It’s best to use a utility like CHKCPU to see what your CPU is capable of, then set your BIOS accordingly.

You can also tell from looking at the chip, at least with Intel 486s. If the chip has dates of 1989 and/or 1992 on it, it only supports write-through. If the chip has both 1989 and 1993 copyright dates and the number SX955 on it, it’s the later version that supports writeback. With AMD and Cyrix it’s tougher. I think 3.3-volt Cyrix chips have writeback capability and earlier 5V chips do not. If you have a non-Intel 486, use CHKCPU to be sure of what it can do.

Later 486 chipsets also allow write-back from the L2 cache. Enabling this improves performance. In most cases, you’ll get more benefit from enabling write-back than you could get by increasing the size of your cache.

Pentium CPUs and most of their equivalents from other companies used write-back with their integrated L1 cache. If you have a Pentium motherboard with L2 cache and it gives you an option, choose writeback mode.

Slowing down a system

Some older titles don’t deal well with a Pentium, or even with a fast 486. In some instances, using writethrough cache instead of writeback may be enough to get a title running, though it may still require use of the system turbo button to slow down the clock rate. In extreme cases, you may need to disable the cache entirely, which in effect turns the system into a fast 386.

If you found this post informative or helpful, please share it!

3 thoughts on “Writeback vs writethrough cache

  • January 10, 2023 at 10:37 am
    Permalink

    For the Intel 486DX2 and 486DX4 models that have L1 cache that is Write-Back capable, the CPU responds with a CPUID depending on which mode the cache is in:

    0436h: 486DX2 WB-capable in Write-Through mode
    0470h: 486DX2 in Write-Back mode

    0483h: 486DX4 WB-capable in Write-Through mode
    0490h: 486DX4 in Write-Through mode

    There are only two Intel 486DX2 ‘S-specs’ able to be set in Write-Back mode, ‘SX954’ (which is marked for 50MHz internally) and ‘SX955’ (the 486DX2-66 that you refer to in the article). I think I have a typo identifying the stepping differently between the 486DX2-50 and 486DX2-66 in my chart (https://www.ardent-tool.com/CPU/486_Step.html)

    For the WB-capable 486DX4-100 CPUs, there are four S-specs I have empirically found: ‘SX158’, ‘SX209’, ‘SK896’, and ‘SK096’; All WB-capable Intel 486DX4 are 3-volt CPUs, but not all 3-volt Intel 486DX4 CPUs are WB-capable. Use the CPUID identifier to know whether an Intel 486DX2 or 486DX4 is WB-capable if the ‘S-spec’ isn’t visible on the CPU.

  • January 11, 2023 at 10:01 am
    Permalink

    I think these were amazing times in computer development. The changes were rapid and the experimentation was fantastic and sometimes erratic. Super fun article. Thanks!

Comments are closed.