Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Brett Glass
I'm building a few systems using dual core Atom processors, and 
have noted that when the system boots up it says it has four CPUs: 
2 actual cores and 2 virtual ones. But performance is a bit 
unsteady, and I'm wondering if it's going to be better to turn 
hyperthreading off.


With hyperthreading, the FreeBSD scheduler simply acts as if there 
are 4 CPUs. Each CPU gets clock interrupts (which add overhead), 
and the scheduler is naive about the fact that two of the CPUs 
are not separate chips and could be held up if its mate has a heavy 
load. I do not know if the supposed higher utilization of the 
resources on each chip (including executing one thread while the 
CPU waits for data for another) is worth it. What has your experience been?


--Brett Glass

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Mark Felder

On Mon, 29 Aug 2011 12:24:08 -0500, Brett Glass br...@lariat.net wrote:

With hyperthreading, the FreeBSD scheduler simply acts as if there are 4  
CPUs. Each CPU gets clock interrupts (which add overhead), and the  
scheduler is naive about the fact that two of the CPUs are not  
separate chips and could be held up if its mate has a heavy load. I do  
not know if the supposed higher utilization of the resources on each  
chip (including executing one thread while the CPU waits for data for  
another) is worth it. What has your experience been?


In my experience hyperthreading is useful in very few environments. I
personally disabled it on my Atom machine which acts as a NAS among
other things. I have noticed an improvement in performance and also in
responsiveness. YMMV, etc etc etc :-)


Regards,


Mark
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Bruce Cran

On 29/08/2011 18:24, Brett Glass wrote:
With hyperthreading, the FreeBSD scheduler simply acts as if there are 
4 CPUs. Each CPU gets clock interrupts (which add overhead), and the 
scheduler is naive about the fact that two of the CPUs are not 
separate chips and could be held up if its mate has a heavy load. I do 
not know if the supposed higher utilization of the resources on each 
chip (including executing one thread while the CPU waits for data for 
another) is worth it. What has your experience been?


Actually, the ULE scheduler does know about HyperThreading and the 
topology of such CPUs. I don't know what it does with the information, 
but it probably works to optimize cache usage etc.


--
Bruce Cran
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Brett Glass

At 01:55 PM 8/29/2011, Bruce Cran wrote:

Actually, the ULE scheduler does know about HyperThreading and the 
topology of such CPUs. I don't know what it does with the 
information, but it probably works to optimize cache usage etc.


Alas, during a recent kernel build, I used the -j2 command line 
option in make and watched as the scheduler repeatedly assigned 
two instances of cc (the most CPU-intensive program) to the same core.


During that process, I also watched CPU utilization in top(1). The 
peak was 46% idle, which means that HTT appeared to be making at 
most a 4% difference. (If the peak were 50% idle, HTT would be 
doing nothing at all, because top(1) can't tell that there aren't 
really 4 CPUs.)


--Brett Glass

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Adam Vande More
On Mon, Aug 29, 2011 at 4:15 PM, Brett Glass br...@lariat.net wrote

 Alas, during a recent kernel build, I used the -j2 command line option in
 make and watched as the scheduler repeatedly assigned two instances of cc
 (the most CPU-intensive program) to the same core.

 During that process, I also watched CPU utilization in top(1). The peak was
 46% idle, which means that HTT appeared to be making at most a 4%
 difference. (If the peak were 50% idle, HTT would be doing nothing at all,
 because top(1) can't tell that there aren't really 4 CPUs.)


You can achieve definitive answers by timing several build runs of each
setting and using ministat.

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread Jerome Herman

On 29/08/2011 23:15, Brett Glass wrote:

At 01:55 PM 8/29/2011, Bruce Cran wrote:

Actually, the ULE scheduler does know about HyperThreading and the 
topology of such CPUs. I don't know what it does with the 
information, but it probably works to optimize cache usage etc.


Alas, during a recent kernel build, I used the -j2 command line option 
in make and watched as the scheduler repeatedly assigned two 
instances of cc (the most CPU-intensive program) to the same core.
I might be wrong, but that would be the result I expect if I were to 
pass -j2 to a dual core CPU. If I wanted the the compilation to run on 
both core I would use -j3. The good old number of cores+1.
I think the last compilation slot is used to prepare the next 
compile/do trivial compile, so that  the cores dedicated to compile can 
switch from one task to the next faster.


The interesting test to do would be if you do -j3 would ULE assign the 
second compile to HT or to second core.




During that process, I also watched CPU utilization in top(1). The 
peak was 46% idle, which means that HTT appeared to be making at most 
a 4% difference. (If the peak were 50% idle, HTT would be doing 
nothing at all, because top(1) can't tell that there aren't really 4 
CPUs.)


H.T varies greatly from one processor to the next, on the Pentium 4 1st 
gen it is a sad joke, on the Atom it is a small help for easy tasks, on 
i7 it is almost as good as a real core (Translation : if you use only 
the HT of a core you will get roughly the same perfs as if you use only 
the direct core)
None the less H.T is just another entry point on the same core, so if HT 
is not used at all you will have 100% CPU power on direct, if direct is 
not used at all you will have 30%-95% cpu power on HT (depending on the 
processor). If both are used at he same time you will get between 
45%+20% (P4 1st gen) to 50%+45% (i7 last gen).
But since raw CPU power is not the only thing that matters in real world 
you can get up to +25% perfs on a I7 with HT enabled.




--Brett Glass

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
freebsd-questions-unsubscr...@freebsd.org


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Turn off hyperthreading on dual core Atom?

2011-08-29 Thread RW
On Mon, 29 Aug 2011 15:15:02 -0600
Brett Glass wrote:

 At 01:55 PM 8/29/2011, Bruce Cran wrote:
 
 Actually, the ULE scheduler does know about HyperThreading and the 
 topology of such CPUs. I don't know what it does with the 
 information, but it probably works to optimize cache usage etc.
 
 Alas, during a recent kernel build, I used the -j2 command line 
 option in make and watched as the scheduler repeatedly assigned 
 two instances of cc (the most CPU-intensive program) to the same core.

Doesn't that make sense. If the scheduler can't put two threads from
the same process on a core, it puts two processes running in the same
binary.

BTW I thought hyperthreading was off by default on security grounds.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org