Re: fair group scheduler not so fair?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Srivatsa Vaddagiri
Date: Friday, May 23, 2008 - 12:44 am

On Thu, May 22, 2008 at 06:17:37PM -0600, Chris Friesen wrote:

No. Moving groups to different cpus is just a group-aware extension to
move_tasks() that is invoked as part of regular load balance operation.
move_tasks()->sched_fair_class.load_balance() has been modified to
understand how much various task-groups at various levels (ex: A at level 1,
B at level 2 etc) contribute to cpu load. It moves tasks between cpus
using this knowledge.

For ex: if we were to consider all tasks shown above to be in same cpu,
CPU0, this is how it would look:

	CPU0		CPU1
       root		root
      / | \
     A  1  2
   /| |\
  3 4 5 B
       / \
      6   7

Then cpu0 load = weight of A + weight of 1 + weight of 2
	       = 1024 + 1024 + 1024 = 3072

while cpu1 load = 0

load to be moved to cut down this imbalance = 3072/2 = 1536

move_tasks() running on CPU1 would try to pull iteratively tasks such
that total weight moved is <= 1536.

	Task moved		Total Weight moved
	---------		------------
	    2			     1024
	    3			     1024 + 256 = 1280
	    5			     1280 + 256 = 1536

resulting in:

      CPU0            CPU1
      root            root
      /  \            /  \
     A    1          A    2
    / \             / \
   4   B           3   5
      / \
     6   7


not exactly ..as Peter put it:

  s_(i,g) = W_g * rw_(i,g) / \Sum_j rw_(j,g)

In this case, 

  s_(0,A) = W_A * rw_(0, A) / \Sum_j rw_(j, A)

W_A = shares given to A by admin = 1024

rw_(0,A) = Weight of 4 + Weight of B = 1024 + 1024 = 2048
rw_(1,A) = Weight of 3 + Weight of 5 = 1024 + 1024 = 2048
\Sum_j rw_(j, A) = 4096

So,

  s_(0,A) = 1024 *2048 / 4096 = 512



Not exactly. rw_(0, B) = \Sum_j rw_(j, B) and that's why s_(0,B) = 1024


Hope this is clarified from above.


-- 
Regards,
vatsa
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fair group scheduler not so fair?, Chris Friesen, (Wed May 21, 4:59 pm)
Re: fair group scheduler not so fair?, Peter Zijlstra, (Wed May 21, 11:56 pm)
Re: fair group scheduler not so fair?, Chris Friesen, (Thu May 22, 1:02 pm)
Re: fair group scheduler not so fair?, Peter Zijlstra, (Thu May 22, 1:07 pm)
RE: fair group scheduler not so fair?, Li, Tong N, (Thu May 22, 1:18 pm)
RE: fair group scheduler not so fair?, Peter Zijlstra, (Thu May 22, 2:13 pm)
Re: fair group scheduler not so fair?, Chris Friesen, (Thu May 22, 5:17 pm)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Fri May 23, 12:44 am)
Re: fair group scheduler not so fair?, Peter Zijlstra, (Fri May 23, 2:39 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Fri May 23, 2:42 am)
Re: fair group scheduler not so fair?, Peter Zijlstra, (Fri May 23, 3:16 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Fri May 23, 3:19 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Tue May 27, 10:15 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Tue May 27, 10:28 am)
Re: fair group scheduler not so fair?, Chris Friesen, (Tue May 27, 11:13 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Wed May 28, 9:33 am)
Re: fair group scheduler not so fair?, Chris Friesen, (Wed May 28, 11:35 am)
Re: fair group scheduler not so fair?, Dhaval Giani, (Wed May 28, 11:47 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Wed May 28, 7:50 pm)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Thu May 29, 9:46 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Thu May 29, 9:47 am)
Re: fair group scheduler not so fair?, Chris Friesen, (Thu May 29, 2:30 pm)
Re: fair group scheduler not so fair?, Dhaval Giani, (Thu May 29, 11:43 pm)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Fri May 30, 3:21 am)
Re: fair group scheduler not so fair?, Srivatsa Vaddagiri, (Fri May 30, 4:36 am)
Re: fair group scheduler not so fair?, Chris Friesen, (Mon Jun 2, 1:03 pm)