Re: High wake up latencies with FAIR_USER_SCHED

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Guillaume Chazarain <guichaz@...>
Cc: Ingo Molnar <mingo@...>, LKML <linux-kernel@...>, <a.p.zijlstra@...>, <dhaval@...>
Date: Tuesday, January 29, 2008 - 1:47 am

On Mon, Jan 28, 2008 at 09:13:53PM +0100, Guillaume Chazarain wrote:

The maximum scheduling latency of a task with group scheduler is:

	Lmax = latency to schedule group entity at level0 + 
	       latency to schedule group entity at level1 +
	       ...
	       latency to schedule task entity at last level

More the hierarchical levels, more the latency looks like. This is particularly 
so because vruntime (and not wall-clock time) is used as the basis of preemption
of entities.  The latency at each level also depends on number of entities at 
that level and sysctl_sched_latency/sched_nr_latency setting.

In this case, we only have two levels - userid + task. So the max scheduling 
latency is:

      Lmax = latency to schedule uid1 group entity (L0) +
	     latency to schedule the sleeper task within uid1 group (L1)

In the first script that you had, uid1 had only one sleeper task, while uid2 has
two cpu-hogs. This means L1 is always zero for the sleeper task. L0 is also 
substantially reduced with the patch I sent (giving sleep credit for group 
level entities). Thus we were able to get low scheduling latencies in the case 
of first script.

The second script you have sent is generating two tasks (sleeper + hog) under 
uid 1 and one cpuhog task under uid 2. Consequently the group-entity 
corresponding to uid 1 is always active and hence there is no question of giving
credit to it for sleeping.

As a result, we should expect worst-case latencies of upto [2 * 10 = 20ms] in 
this case. The results you have fall within this range.

In case of !FAIR_USER_SCHED, the sleeper task always gets sleep-credits
and hence its latency is drastically reduced.

IMHO this is expected results and if someone really needs to cut down
this latency, they can reduce sysctl_sched_latency (which will be bad
from perf standpoint, as we will cause more cache thrashing with that).



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

Messages in current thread:
High wake up latencies with FAIR_USER_SCHED, Guillaume Chazarain, (Sun Jan 27, 4:01 pm)
Re: High wake up latencies with FAIR_USER_SCHED, Srivatsa Vaddagiri, (Sun Jan 27, 10:31 pm)
Re: High wake up latencies with FAIR_USER_SCHED, Guillaume Chazarain, (Mon Jan 28, 12:57 pm)
Re: High wake up latencies with FAIR_USER_SCHED, Guillaume Chazarain, (Mon Jan 28, 4:13 pm)
Re: High wake up latencies with FAIR_USER_SCHED, Peter Zijlstra, (Thu Jan 31, 6:47 am)
Re: High wake up latencies with FAIR_USER_SCHED, Guillaume Chazarain, (Thu Jan 31, 8:49 am)
Re: High wake up latencies with FAIR_USER_SCHED, Peter Zijlstra, (Thu Jan 31, 9:00 am)
Re: High wake up latencies with FAIR_USER_SCHED, Srivatsa Vaddagiri, (Tue Jan 29, 1:47 am)
Re: High wake up latencies with FAIR_USER_SCHED, Guillaume Chazarain, (Tue Jan 29, 11:53 am)
Re: High wake up latencies with FAIR_USER_SCHED, Srivatsa Vaddagiri, (Tue Jan 29, 12:26 pm)
Re: High wake up latencies with FAIR_USER_SCHED, Ingo Molnar, (Mon Jan 28, 8:27 am)