Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Applications bouncing around on a hyperthreaded system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
lednakashim
n00b
n00b


Joined: 09 Jun 2010
Posts: 14

PostPosted: Sun Dec 09, 2012 10:50 pm    Post subject: Applications bouncing around on a hyperthreaded system? Reply with quote

I have a ultra-high-end, top-of-the-line Intel core i3 laptop and I am always surprised by my cpu utilization and affinities, especially when it comes to hyperthread utilization. I wonder if there is a way that I can prevent the system from moving around threads, especially if it moves them to HT cores.

For example, I am running a single core physics simulation I wrote and Thunderbird. I see both processes jump around aimlessly between processors. I see Thunderbird cycle through all cores 0,1,2,3 and likewise I see the physics simulation cycle through all cores. The average time spent on a core is about 2 seconds. Whats strange is that the system sometimes puts these processes onto the HT core with what appears to be little utilization of the physical core.

My physics simulation gets an about 10% performance boost when I manually set the CPU affinity (then it doesn't jump everywhere), which makes me wonder if there is something suboptimal with how my process affinities are being managed.

Is there some way for me to hint to kernel how to better manage my applications? For example only to use the HT when the system is under extreme stress.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Sun Dec 09, 2012 11:49 pm    Post subject: Reply with quote

Intel cpu boost mhz on a core if few cores are in use, so you may get your cpu boost from that on your application when not jumping on all cores.

I would look at CONFIG_PREEMPT* settings in the kernel to try to lower the core jumping effect you have (specially the CONFIG_PREEMPT_VOLUNTARY one if set).
Maybe review your scheduling model in use too.
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2409
Location: UK

PostPosted: Sun Dec 09, 2012 11:56 pm    Post subject: Reply with quote

You could try a kernel with the BFS scheduler.
Back to top
View user's profile Send private message
smartass
Apprentice
Apprentice


Joined: 04 Jul 2011
Posts: 189
Location: right behind you ... (you did turn around, didn't you?)

PostPosted: Mon Dec 10, 2012 6:05 am    Post subject: Reply with quote

You could experiment with stuff like CONFIG_SCHED_MC (multi-core) and/or CONFIG_SCHED_SMT (hyperthreading) to optimize the scheduler for your system.

You could also try to use cgroups to set the affinity automatically.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2586

PostPosted: Mon Dec 10, 2012 6:17 am    Post subject: Reply with quote

I didn't think Core-I3 had HT - I thought that was only on Core-I7.

I don't know if it's in the kernel yet, but I'm under the impression that there is work ongoing to "stick" things to one core, yet allow it to move if that could allow significant power reduction. (like shutting down one core, moving the work to other(s))
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
pilla
Administrator
Administrator


Joined: 07 Aug 2002
Posts: 7214
Location: Pelotas, BR

PostPosted: Thu Dec 20, 2012 10:58 am    Post subject: Reply with quote

Moved from Gentoo Chat to Off the Wall.

You can set CPU sets or even pin threads to specific cores. Mind you that HT is multithreading on the same core, even though it appears as two.

It seems that newer i3 processors [url=http://ark.intel.com/products/65693/Intel-Core-i3-3220-Processor-(3M-Cache-3_30-GHz)]also have HT[/url].
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
Prenj
n00b
n00b


Joined: 20 Nov 2011
Posts: 13

PostPosted: Thu Dec 20, 2012 2:06 pm    Post subject: Reply with quote

http://www.cyberciti.biz/tips/setting-processor-affinity-certain-task-or-process.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum