简体   繁体   English

多线程缓存未命中利用

[英]Multithreaded Cache Miss Exploiting

When I eg.当我例如。 iterate over a linked list and become really unlucky, I will have ~ 0% cache-hitrate (let's assume this anyways).遍历一个链表并变得非常不走运,我将有 ~ 0% 的缓存命中率(让我们假设这无论如何)。 Let's also assume I have a CPU that can only run one Instruction at a time (no multicore / hyperthreads) for simplicity.为简单起见,我们还假设我有一个 CPU 一次只能运行一条指令(没有多核/超线程)。 Cool.凉爽的。 Now with my 0% hitrate the CPU / program is spending 99% of the time waiting for data.现在我的命中率为 0%,CPU / 程序花费 99% 的时间等待数据。

Question : If a thread is waiting for data from the RAM / disk is that core blocked?问题:如果一个线程正在等待来自 RAM / 磁盘的数据,该核心是否被阻塞? Or can I exploit the low cache-hitrate by running other threads (or another way that is not todo with increasing the hitrate) to not have the CPU exclusively wait for data and do other work instead?或者我可以通过运行其他线程(或另一种与增加命中率无关的方式)来利用低缓存命中率,而不是让 CPU 专门等待数据并做其他工作吗?

If you run SMT, then the other thread can grap all the core resources and hence cover over the cache miss (at least partially).如果您运行 SMT,那么另一个线程可以获取所有核心资源,从而覆盖缓存未命中(至少部分)。

I know of no processor that makes task switch on cache miss, but I know several architectures that use SMT-2/4/8 (yes some Power CPU's have SMT-8) to cover over such cases.我知道没有处理器会在缓存未命中时切换任务,但我知道有几种架构使用 SMT-2/4/8(是的,一些 Power CPU 具有 SMT-8)来覆盖这种情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM