Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 2009 22:39:26 +0200 (CEST)
From:      Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
To:        Yuri <yuri@rawbw.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Why build's user CPU on 4-CPU machine with hyper-threading always higher with -j 8 compared to with -j 4?
Message-ID:  <alpine.BSF.2.00.0905232235250.27154@wojtek.tensor.gdynia.pl>
In-Reply-To: <4A1853AA.9060407@rawbw.com>
References:  <4A1853AA.9060407@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I noticed that the same exact build on i7-920 (4 CPUs) consumes ~15% more 
> user CPU when run with -j 8 compared to -j 4.
>
> Hyper-threading is enabled so top shows 8 CPUs.
>
> Why would user time be higher in a  hyper-threaded run?
because it doesn't count actual instruction executed but - as name suggest 
- time.


with -j 8 it sums time of 8 pseudo-processors

single pseudo-processor ("half" of single core) is slower than 
full-processor.

The whole trick with hyperthreading is that it's less than half slower, as 
one "pseudo-processor" become full-processor every time that second 
"pseudo-processor" is stalled on memory access.

today memory access to DRAM means over hundred of CPU cycles. out of order 
execution can execute other instruction to some extent, but only "some".

even L3 cache access costs >>10 CPU cycles



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0905232235250.27154>