简体   繁体   English

超线程和CPU绑定进程

[英]Hyper-Threading and CPU-bound processes

So I'm running a cpu intensive task that isn't parallelized on my i7 laptop. 因此,我正在执行i7笔记本电脑无法并行执行的CPU密集型任务。

KSysGuard reports that I'm using 12.5% of the available cpu. KSysGuard报告我正在使用可用CPU的12.5%。

If I disable hyper threading am I likely to get a meaningful performance increase? 如果禁用超线程,是否有可能获得有意义的性能提升? It'll require flashing a new BIOS, so I wanted an opinion before I get too involved in the idea... 它需要刷新一个新的BIOS,所以我想先提出意见,然后再参与其中。

Thanks, 谢谢,

N ñ

Your task is using all of a single core, not 12.5% of one. 您的任务是使用单个内核的全部,而不是单个内核的12.5%。 12.5% is 1/8 - you're maxing out one of the eight hardware threads your hyperthreaded quad-core processor has. 12.5%是1/8-您正在使超线程四核处理器拥有的八个硬件线程中的一个最大化。 If you disable hyperthreading, you'll have only four hardware threads, so your tools will report 25% usage - but your task won't complete any more quickly. 如果禁用超线程,则只有四个硬件线程,因此您的工具将报告25%的使用率-但您的任务将无法更快地完成。

If you want to use more of your processor, try to parallelize the work. 如果要使用更多的处理器,请尝试并行处理工作。

I believe way hyperthreading works is that when running a single thread, on average only half the available stages in the core's pipeline are in use. 我相信超线程的工作方式是,在运行单个线程时,平均仅使用内核管道中可用阶段的一半。 HT tries to "interweave" two threads to improve CPU utilisation. HT尝试“交织”两个线程以提高CPU利用率。

This does mean each of the two threads can run slower than it otherwise would since they have to wait for one another, while the overall throughput of a given core is improved. 这确实意味着两个线程中的每个线程都可以比其他线程运行得慢,因为它们必须互相等待,同时给定内核的整体吞吐量得以提高。 However, if you're not running under load, I'd say it's unlikely that the "peanut gallery" will get scheduled on the core that is busy as opposed to the cores that aren't doing anything. 但是,如果您没有在负载下运行,那么我想说“花生画廊”不太可能在繁忙的核心上进行调度,而不是什么都不做。

(Of course, this being modern CISC performance, it's hard to say anything with certainty based on a theorethical analysis.) (当然,这是现代CISC的表现,基于理论分析很难确定地说什么。)

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

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