Why is performance degrading after enabling hyperthread?

I am transferring the Linux 2.6.32 kernel to Intel (R) Xeon (R) CPU E31275 @ 3.40 GHz. If I enable hyperthread in the BIOS, I can see 8 processor cores (CPU0 ~ CPU7). Most interruptions occur in CPU 4, and the CPU utilization of this core is much higher than that of others (almost twice as much as others). I do not understand this very well, because I think I have not set up any IRQ binding operations.

If I disable hyperthread in the BIOS, then everything will be fine. IRQs were balanced, and the CPU utilization of all cores (CPU0 ~ CPU3) was also balanced.

Can someone explain this? Is this related to the BIOS? Do I have to make some special settings in the kernel?

+4
source share
1 answer

Some programs get the negative effect of HT (Hyper Threading), to explain this, you need to understand what HT is. As you said, you saw 7 (0-7 - this is only 8) processor cores, it’s not, you have 4 cores in your processor, 8 cores are virtual cores, so one core has 2 threads (and it works as if he had 2 cores). Typically, HT helps run programs faster because the processor / OS can run (by doing what these programs ever do) 8 programs at a time, without HT you can only run 4 at a time. You do not need to set any settings, since you cannot change this appearance, if you are a developer of this program, you must double-check the code and optimize it for HT if you want, or just disable HT.

Other information due to some shitty people says: HT increases processor power this is not true! even if you see 8 cores with a resolution of 4 GHz (GHz says nothing, you need to measure on the flop), you got the same power as when you turned on HT and got 4 cores with a frequency of 4 GHz. If you have HT on 2 virtual cores, they share 1 physical core from the ur processor.

Here's more info on HT: http://www.makeuseof.com/tag/hyperthreading-technology-explained/

I could not find my old link to a very good site where there are code fragments that show bad code for HT and good code (in the sense of bad slow than without HT and vice versa).

TL DR: not every program benefits from HT due to its development.

+5
source

Source: https://habr.com/ru/post/1412451/


All Articles