about cpu bandwidth in cfs

Submitted by attila
on March 27, 2009 - 11:34am

I made the scheduler's configuration in kernel (2.6.29) like this:

GROUP_SCHED = 1
FAIR_GROUP_SCHED = 1
USER_SCHED = 1

The machine's cpu is an Intel Q9300 (Quad). The system is a Debian/Lenny and the /sys/kernel/uids/*/cpu_share = 1024 for all users but root.

I expected to see users sharing equal cpu power in % but it not happened:

top -d 5.2

5941 user1 20 0 9144 3256 524 R 36 0.2 63:16.94
3798 user2 20 0 13624 2936 600 R 31 0.1 1185:54
3810 user2 20 0 13624 2936 600 R 31 0.1 1183:37
5939 user1 20 0 9144 3252 524 R 30 0.2 55:39.42
3816 user2 20 0 13624 2936 600 R 28 0.1 1182:03
3804 user2 20 0 13624 2932 600 R 26 0.1 1197:34
6001 user3 20 0 10160 3280 532 R 21 0.2 35:24.51
5998 user3 20 0 10160 3280 532 R 21 0.2 35:25.10
6000 user3 20 0 10160 3280 532 R 20 0.2 33:49.52
5999 user3 20 0 10160 3284 532 R 20 0.2 33:49.85
5962 user4 20 0 10160 3280 532 R 19 0.2 34:01.72
5966 user4 20 0 10160 3272 532 R 19 0.2 33:50.64
5961 user4 20 0 10160 3284 532 R 18 0.2 30:58.23
5965 user4 20 0 10160 3280 532 R 18 0.2 30:57.45
5964 user4 20 0 10160 3268 532 R 16 0.2 28:22.55
5960 user4 20 0 10160 3276 532 R 16 0.2 28:23.44
5963 user4 20 0 10160 3276 532 R 15 0.2 27:12.32
5967 user4 20 0 10160 3272 532 R 15 0.2 26:38.44

This result shows cpu's share:

user1: 66 %
user2: 116 %
user3: 82 %
user4: 136 %

I expected to see the same % for each user (or approximately 100% for each user). I runned the command several times with approximately the same results. The processes are cpu-intensive, ie, they fill 100% of a core if left alone.

The distribution of cpu's time should be the way that i expected?
It is something wrong in the configuration's scheduler?