2012-06-16 17:18:42

by Chen

[permalink] [raw]
Subject: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

This is the Googlecode link of RIFS series.
http://code.google.com/p/rifs-scheduler/

Here is the download link for RIFS.ES-v1-kernel3.4.x:
http://rifs-scheduler.googlecode.com/files/RIFS.ES-v1-kernel3.4.x

The design of RIFS/ES:

First let me list out the 3 equations of SystemV scheduling.

? 0.cpu = cpu +1;
1.cpu = cpu/2;
2.priority = (cpu/2) + base level priority;

These 3 equations are used to determine the scheduling priority if a
task. Here there is no any complex detection of interactive task(O(1)
failed on desktop because of the complex detection). O(1) did a
hard-coding and kerp focusing on how to detect a whether the task is
an interactive task or not.
CFS is good with its beautiful design. But in my opinion i think the
sleeper feature will destroy the beautiful design.

RIFS-ES adopt the design of System V scheduler.
It can be interactive. On my box everything is very smopth
Chen


Attachments:
RIFS.ES-v1-kernel3.4.x (283.06 kB)

2012-06-17 06:24:49

by Mike Galbraith

[permalink] [raw]
Subject: Re: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

On Sun, 2012-06-17 at 01:18 +0800, Chen wrote:

> CFS is good with its beautiful design. But in my opinion i think the
> sleeper feature will destroy the beautiful design.

Destroys may be a bit strong, but it does have it's problems, one being:
as resource contention increases, so does total sleep.

It would be great to come up with a model that works as well at letting
light tasks compete without the downsides, but until that happens, this
model is better than none at all. With no wakeup preemption model, the
scheduler is not fair to light tasks, a big hairy wart IMHO, which mars
the beauty more than sleep model "beauty marks" (ok, so they're warts).

"Beauty is in the eye of the beholder" and "Perfect is the enemy of
good" are both applicable.. as is "Math is hard, let's go shopping" :)

-Mike

2012-06-17 08:20:09

by Chen

[permalink] [raw]
Subject: Re: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

On Sun, Jun 17, 2012 at 2:24 PM, Mike Galbraith <[email protected]> wrote:
> Destroys may be a bit strong, but it does have it's problems, one being:
> as resource contention increases, so does total sleep.

Sleeper feature(I mean the re-designed sleeper fairness) give too much
resources to the sleep task. They need to wake up with smaller latency
but if they were given too much priority it will be harmful to the
other interactive tasks eg. X. Under high IO load the sleeper fairness
feature can causes music lag or X lag. We can't remove it since there
is no any tuning to turn this off from 2.6.31.

CFS can still be simplified and optimised.

RIFS-ES uses different way to do this.

if((p->state != TASK_RUNNING) || (p->tick_used >= MAX_TICK_USED)) {
p->tick_used /= 2;
}

Here, an cpu intensive task won't be punished too heavy. also this can
improve the wake up latency of 50+% CPU_BOUND tasks.

if(p->sleep_cnt < MAX_SLEEP_COUNT)
p->sleep_cnt++;

If a task sleep the sleep_cnt increase.

#define prio_raisable(p) ( \
p->prio > ((p->static_prio - reverse(MAX_TICK_USED, p->tick_used)) + \
(p->sleep_cnt / 3)))

Priority of a task that is going to sleep is decided by its time spent
on running. sleep_cnt is the sleep rate of a task.

if(prio_raisable(p))
p->prio--;
if(sleep_jiffy != p->sleep_jiffy)
p->sleep_cnt /= 2;
p->sleep_jiffy = sleep_jiffy;

With this, if the sleep rate of a task is low, the sleep rate will be
divide by 2 and it can wake up with a lower latency.
That is the reason why I call this scheduler RIFS-ES.(RIFS and
enhancement of Unix System V scheduling).

2012-06-17 22:24:44

by Chen

[permalink] [raw]
Subject: Re: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

Sorry for my fault.
The patch has build issue and I post the new one.


Attachments:
RIFS.ES-v1-kernel3.4.x (191.11 kB)

2012-06-18 03:01:08

by Vikram Dhillon

[permalink] [raw]
Subject: Re: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

On Sun, Jun 17, 2012 at 6:24 PM, Chen <[email protected]> wrote:
> Sorry for my fault.
> The patch has build issue and I post the new one.

Hi Chen,

It is always very interesting to see new scheduler designs however can
you shows us some benchmarks? How does this compare to CFS currently?
Also how well does it scale beyond desktops?

- Vikram

2012-06-18 06:28:13

by Chen

[permalink] [raw]
Subject: Re: [PATCH][ANNOUNCE]RIFS-ES Scheduling V1 release.

On Mon, Jun 18, 2012 at 11:01 AM, Vikram Dhillon
<[email protected]> wrote:
> On Sun, Jun 17, 2012 at 6:24 PM, Chen <[email protected]> wrote:
>> Sorry for my fault.
>> The patch has build issue and I post the new one.
>
> Hi Chen,
>
> It is always very interesting to see new scheduler designs however can
> you shows us some benchmarks? How does this compare to CFS currently?
> Also how well does it scale beyond desktops?
>
> - Vikram


Here is the benchmark result(Latency) for RIFS-ES and CFS(I have done
them with computer and I am posting them with my Android phone now)

RIFS-ES
========================================
[root@localhost admin]# latt -c1 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=1
Entries logged: 27

Wakeup averages
-------------------------------------
Max 25 usec
Avg 10 usec
Stdev 3 usec
Stdev mean 1 usec

Work averages
-------------------------------------
Max 20265 usec
Avg 20100 usec
Stdev 82 usec
Stdev mean 16 usec
[root@localhost admin]# latt -c2 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=2
Entries logged: 54

Wakeup averages
-------------------------------------
Max 824 usec
Avg 30 usec
Stdev 117 usec
Stdev mean 16 usec

Work averages
-------------------------------------
Max 21472 usec
Avg 20486 usec
Stdev 190 usec
Stdev mean 26 usec
[root@localhost admin]# latt -c4 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=4
Entries logged: 104

Wakeup averages
-------------------------------------
Max 20423 usec
Avg 2343 usec
Stdev 3810 usec
Stdev mean 374 usec

Work averages
-------------------------------------
Max 41037 usec
Avg 36096 usec
Stdev 4247 usec
Stdev mean 416 usec
[root@localhost admin]# latt -c8 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=8
Entries logged: 184

Wakeup averages
-------------------------------------
Max 71284 usec
Avg 6112 usec
Stdev 9640 usec
Stdev mean 711 usec

Work averages
-------------------------------------
Max 83043 usec
Avg 68615 usec
Stdev 10615 usec
Stdev mean 783 usec
[root@localhost admin]# latt -c16 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=16
Entries logged: 320

Wakeup averages
-------------------------------------
Max 35669 usec
Avg 9690 usec
Stdev 8961 usec
Stdev mean 501 usec

Work averages
-------------------------------------
Max 166790 usec
Avg 136161 usec
Stdev 30660 usec
Stdev mean 1714 usec


RIFS-ES: Total result for wake up average latency:
-c1:
Avg 10 usec
-c2:
Avg 30 usec
-c4:
Avg 2343 usec
-c8:
Avg 6112 usec
-c16:
Avg 9690 usec

CFS
========================================
[root@localhost ~]$ latt -c1 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=1
Entries logged: 27

Wakeup averages
-------------------------------------
Max 40 usec
Avg 21 usec
Stdev 8 usec
Stdev mean 2 usec

Work averages
-------------------------------------
Max 20648 usec
Avg 20262 usec
Stdev 97 usec
Stdev mean 19 usec
[root@localhost ~]$ latt -c2 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=2
Entries logged: 54

Wakeup averages
-------------------------------------
Max 45 usec
Avg 19 usec
Stdev 10 usec
Stdev mean 1 usec

Work averages
-------------------------------------
Max 21549 usec
Avg 20495 usec
Stdev 320 usec
Stdev mean 43 usec
[root@localhost ~]$ latt -c4 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=4
Entries logged: 104

Wakeup averages
-------------------------------------
Max 20430 usec
Avg 4900 usec
Stdev 6274 usec
Stdev mean 615 usec

Work averages
-------------------------------------
Max 50538 usec
Avg 30564 usec
Stdev 6492 usec
Stdev mean 637 usec
[root@localhost ~]$ latt -c8 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=8
Entries logged: 184

Wakeup averages
-------------------------------------
Max 38195 usec
Avg 8068 usec
Stdev 8132 usec
Stdev mean 599 usec

Work averages
-------------------------------------
Max 83525 usec
Avg 67597 usec
Stdev 10037 usec
Stdev mean 740 usec
[root@localhost ~]$ latt -c16 sleep 10

Parameters: min_wait=100ms, max_wait=500ms, clients=16
Entries logged: 320

Wakeup averages
-------------------------------------
Max 83711 usec
Avg 17497 usec
Stdev 21219 usec
Stdev mean 1186 usec

Work averages
-------------------------------------
Max 166547 usec
Avg 119376 usec
Stdev 31758 usec
Stdev mean 1775 usec


CFS: Total result for wake up average latency:
-c1:
Avg 21 usec
-c2:
Avg 19 usec
-c4:
Avg 4900 usec
-c8:
Avg 8068 usec
-c16:
Avg 17497 usec