atom feed67 messages in org.freebsd.freebsd-hackersRe: [RFT][patch] Scheduling for HTT a...
FromSent OnAttachments
Alexander MotinFeb 5, 2012 11:04 pm 
David XuFeb 5, 2012 11:59 pm 
Gary JennejohnFeb 6, 2012 2:08 am 
Alexander BestFeb 6, 2012 8:01 am 
Alexander MotinFeb 6, 2012 8:28 am 
Tijl CoosemansFeb 6, 2012 9:37 am 
Alexander MotinFeb 6, 2012 9:54 am 
Florian SmeetsFeb 6, 2012 11:07 am 
Alexander BestFeb 6, 2012 11:10 am 
Alexander MotinFeb 6, 2012 11:18 am 
Julian ElischerFeb 6, 2012 10:10 pm 
Ivan VorasFeb 8, 2012 3:06 am 
Andriy GaponFeb 11, 2012 5:34 am 
Alexander MotinFeb 11, 2012 6:21 am 
Konstantin BelousovFeb 11, 2012 7:35 am 
Andriy GaponFeb 11, 2012 9:04 am 
Alexander MotinFeb 13, 2012 11:56 am 
Jeff RobersonFeb 13, 2012 12:23 pm 
Alexander MotinFeb 13, 2012 12:54 pm 
Jeff RobersonFeb 13, 2012 1:39 pm 
Alexander MotinFeb 13, 2012 2:38 pm 
Alexander MotinFeb 15, 2012 11:46 am 
Jeff RobersonFeb 15, 2012 11:54 am 
Alexander MotinFeb 15, 2012 12:06 pm 
Alexander MotinFeb 15, 2012 8:41 pm 
Alexander MotinFeb 16, 2012 12:48 am 
Alexander MotinFeb 16, 2012 2:58 am 
Florian SmeetsFeb 16, 2012 1:28 pm 
Alexander MotinFeb 17, 2012 8:29 am 
Arnaud LacombeFeb 17, 2012 8:52 am 
Alexander MotinFeb 17, 2012 9:02 am 
George MitchellFeb 26, 2012 4:32 pm 
George MitchellFeb 26, 2012 4:37 pm 
Olivier SmedtsFeb 27, 2012 2:34 am 
George MitchellFeb 27, 2012 3:23 am 
Olivier SmedtsFeb 27, 2012 3:27 am 
Andriy GaponFeb 27, 2012 4:41 am 
George MitchellFeb 27, 2012 3:54 pm 
Adrian ChaddMar 2, 2012 3:05 pm 
George MitchellMar 2, 2012 4:14 pm 
Adrian ChaddMar 2, 2012 7:24 pm 
Alexander MotinMar 2, 2012 11:40 pm 
Ivan KlymenkoMar 3, 2012 12:18 am 
Adrian ChaddMar 3, 2012 12:59 am 
Alexander MotinMar 3, 2012 1:12 am 
Alexander MotinMar 3, 2012 4:53 am 
Ivan KlymenkoMar 3, 2012 7:25 am 
Alexander MotinMar 3, 2012 8:30 am 
Mario LoboMar 3, 2012 8:56 am 
Alexander MotinMar 3, 2012 9:56 am 
Ivan KlymenkoMar 3, 2012 11:15 am 
Arnaud LacombeApr 5, 2012 11:11 am 
Alexander MotinApr 5, 2012 11:45 am 
Attilio RaoApr 6, 2012 7:12 am 
Alexander MotinApr 6, 2012 7:26 am 
Attilio RaoApr 6, 2012 7:30 am 
Alexander MotinApr 6, 2012 7:40 am 
Alexander MotinApr 9, 2012 12:57 pm 
Arnaud LacombeApr 10, 2012 9:57 am 
Alexander MotinApr 10, 2012 10:18 am 
Alexander MotinApr 10, 2012 10:53 am 
Arnaud LacombeApr 10, 2012 11:45 am 
Alexander MotinApr 10, 2012 12:13 pm 
Mike MeyerApr 10, 2012 1:04 pm 
Arnaud LacombeApr 10, 2012 1:50 pm 
Mike MeyerApr 10, 2012 2:19 pm 
Adrian ChaddApr 11, 2012 3:19 pm 
Subject:Re: [RFT][patch] Scheduling for HTT and not only
From:Tijl Coosemans (ti@coosemans.org)
Date:Feb 6, 2012 9:37:19 am
List:org.freebsd.freebsd-hackers

On Monday 06 February 2012 17:29:14 Alexander Motin wrote:

On 02/06/12 18:01, Alexander Best wrote:

On Mon Feb 6 12, Alexander Motin wrote:

I've analyzed scheduler behavior and think found the problem with HTT. SCHED_ULE knows about HTT and when doing load balancing once a second, it does right things. Unluckily, if some other thread gets in the way, process can be easily pushed out to another CPU, where it will stay for another second because of CPU affinity, possibly sharing physical core with something else without need.

I've made a patch, reworking SCHED_ULE affinity code, to fix that: http://people.freebsd.org/~mav/sched.htt.patch

This patch does three things: - Disables strict affinity optimization when HTT detected to let more sophisticated code to take into account load of other logical core(s). - Adds affinity support to the sched_lowest() function to prefer specified (last used) CPU (and CPU groups it belongs to) in case of equal load. Previous code always selected first valid CPU of evens. It caused threads migration to lower CPUs without need. - If current CPU group has no CPU where the process with its priority can run now, sequentially check parent CPU groups before doing global search. That should improve affinity for the next cache levels.

Who wants to do independent testing to verify my results or do some more interesting benchmarks? :)

i don't have any benchmarks to offer, but i'm seeing a massive increase in responsiveness with your patch. with an unpatched kernel, opening xterm while unrar'ing some huge archive could take up to 3 minutes!!! with your patch the time it takes for xterm to start is never> 10 seconds!!!

Thank you for the report. I can suggest explanation for this. Original code does only one pass looking for CPU where the thread can run immediately. That pass limited to the first level of CPU topology (for HTT systems it is one physical core). If it sees no good candidate, it just looks for the CPU with minimal load, ignoring thread priority. I suppose that may lead to priority violation, scheduling thread to CPU where higher-priority thread is running, where it may wait for a very long time, while there is some other CPU with minimal priority thread. My patch does more searches, that allows to handle priorities better.

But why would unrar have a higher priority?