3

I have searched Intel manual Vol.4. MSR 0x1a4 can control L1 cache prefetcher and L2 cache prefetcher, but I just want to disable L3 cache prefetcher. Which MSR can control it?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Jack
  • 33
  • 4

1 Answers1

4

There is no dedicated L3 prefetcher in current Intel processors. However, starting with Sandy Bridge, the L2 streaming prefetcher can choose to either prefetch into the L3 cache or the L2 cache. This is briefly discussed in the Intel Optimization Manual.

LLC prefetching can be disabled separately, but Intel has only disclosed how to do this to BIOS vendors. On a Xeon SP of any generation, there is a BIOS option called something like "LLC prefetch" that you can use to enable or disable LLC prefetching. If disabled, it may reduce the aggressiveness of the L2 streamer but it can still prefetch into the L2. As you may already know, Intel has disclosed how to fully disable any and all L1D and L2 prefetchers on all Intel x86 processors via MSR registers.

Other related prefetch mechanisms on Xeon SP include sending a prefetch request to a locally homed cacheable address if the access to the L3 is predicted to miss and similarly sending a prefetch request to a remotely homed (cross-socket in particular) cacheable location. These are useful because a significant fraction of an L2-miss access latency is spent on the L3 lookup operation for hit/miss determination. There are BIOS options to control these prefetching mechanisms as well. The exact names depend on the BIOS vendor. But note that prefeched lines in these cases bypass the L3 like what happens with any other core-originated request. Technically speaking, though, such prefetch requests are sent by the L3.

All prefetching mechanisms are normally enabled by default, except for LLC Prefetch, which may be disabled by default.

Hadi Brais
  • 22,259
  • 3
  • 54
  • 95
  • 2
    The LLC prefetch mechanism is disabled by default on all my Dell servers. I did some testing with it enabled and found only minimal impact on performance -- sometimes a little faster, sometimes a little slower, mostly very similar. The SKX/CLX processors have the unusual characteristic that single-thread cross-socket bandwidth is higher than single-thread local bandwidth for many memory access patterns. – John D McCalpin Mar 21 '21 at 16:46
  • @JohnDMcCalpin Good observation. I've just checked on a PowerEdge R440 server and the LLC prefetch option is disabled by default. I wonder why. It's possible, but perhaps unlikely, that Intel has it disabled by default and Dell just keeps whatever the default value that Intel has chosen for whatever reason. There is no such BIOS option on any client systems AFAIK, so it's presumably enabled by default at least on client by Intel. – Hadi Brais Mar 21 '21 at 22:43