# Long standing ULE scheduler problem with CPU intensive tasks



## hsn (Aug 20, 2011)

ULE scheduler in 7.X and 8.X (maybe in 6 too) has one scenario where it performs really bad. I remember that oldest release of ULE worked in this scenario well (better than 4bsd) but all following ULE versions are really bad in this.

How to reproduce:

run some CPU eating task on lowest priority (best for testing is distributed.net client, because it is included in ports)
then compile something which is using autoconf ./configure script

You will notice huge performance drop due to background dnetc client. Compile (especially ./configure stuff) runs really slow. It should run on the same speed as without dnetc because intelligent scheduler will steal CPU time from dnetc in favor of compiling. Dnetc is running at nice level 20 after all.

ULE scheduler can be tuned via sysctl a bit but i was not able to do any significant improvement


----------



## fidaj (Sep 26, 2011)

Which CPU in your system where you done the tests?


----------



## hsn (Sep 26, 2011)

single Intel (in vmware) and dualcore intel on real hw.


----------



## fidaj (Sep 26, 2011)

hsn said:
			
		

> single Intel (in vmware) and dualcore intel on real hw.



May cause performance degradation when the hyper-threading?
Try to disable hyper-threading and look at the changes ...

```
echo "machdep.hyperthreading_allowed=0" >> /boot/loader.conf
```

At one-core and dual-core processors performance on the ULE scheduler does not suit me too...
I had to use the scheduler for Core2Duo - 4BSD.


----------



## hsn (Sep 26, 2011)

none of them supports HT. Did you tried my how-to repeat test?


----------



## fidaj (Sep 26, 2011)

hsn said:
			
		

> none of them supports HT. Did you tried my how-to repeat test?



I have a Core2Duo processor - it also does NOT support hyper-threading, but disabling hyper-threading allows the kernel to properly use the topology of my CPU...

I do not repeat your test, but I noticed the same problem with ULE on other tasks running on my laptop...


----------



## fidaj (Sep 26, 2011)

For ULE may have to do more and sysctl kern.sched.steal_htt=0 ...


----------



## fidaj (Oct 31, 2011)

Will it help in your case?
http://docs.freebsd.org/cgi/mid.cgi?20111022132817.35db5ccd


----------



## hsn (Oct 31, 2011)

steal_htt to 0 didn't make any difference.

I will try patch after it will get integrated in v10.


----------

