4 ms·
Would it be possible to dynamically choose the padding at server start time? Given that cache line sizes vary that seems like it might be a prudent choice.
by Jweb_Guru 10y ago
Would it be possible to dynamically choose the padding at server start time? Given that cache line sizes vary that seems like it might be a prudent choice.
- anarazel 10y ago> Would it be possible to dynamically choose the padding at server start time? I doubt it. Allowing the compiler to generate accesses with lea et al. is quite beneficial; and that'd likely be gone by making this not be a compile time constant. It'd also end up being a tuning knob very very few knew how to tune... > Given that cache line sizes vary that seems like it might be a prudent choice. They usually only vary between architectures. Netburst IIRC was the last time x86 cache line sizes varied. If there's any doubt it's usually ok to just use the higher (128 byte) line size, the "unused" padding cache-line will never be accessed and thus not occupy cache space.
- Ono-Sendai 10y agocache line size is 64 B on recent intel CPUs.
- anarazel 10y agoThat's why I said that we'd use a smaller cache-line size for most architectures. PPC uses 128byte tho..
- Ono-Sendai 10y agook.