torokernel / torokernel

This repository contains the source code of toro unikernel
http://torokernel.io
GNU General Public License v3.0
153 stars 28 forks source link

Investigate How to improve execution of threads by using Hyper-threading #234

Open MatiasVara opened 6 years ago

MatiasVara commented 6 years ago

Hyper-threading is the ability of a logical processor to run multiples threads in the same logical processor. Each execution thread shares the logical processor resources. From here:

For example, if one CPU is going flat out and the other CPU is idle, then the first CPU gets %100 of the resources and runs fast, but if the second CPU starts trying to go flat out too then the first CPU will get less CPU resources and start running slower.

We need to investigate in which scenarios hyperthreading can improve the execution. It may be needed an special API for the user.

To enable hpt in kvm use: --vcpus=2,sockets=1,cores=1,threads=2

MatiasVara commented 6 years ago

The hpt can improve the energy consumption. For example, if we have two execution threads in two different cores that may alternate between idle and active, it would be better to put them in the same core but in different threads. This way we can just halt the other core.

MatiasVara commented 6 years ago

image