Re: [PATCH] O3int interactivity for 2.5.74-mm2

Davide Libenzi
2003-07-08T07:39:41Z

On Tue, 8 Jul 2003, Szonyi Calin wrote:

> In the weekend i did some experiments with the defines in kernel/sched.c
> It seems that changing in MAX_TIMESLICE the "200" to "100" or even "50"
> helps a little bit. (i was able to do a make bzImage and watch a movie
> without noticing that is a kernel compile in background)

I bet it helps. Something around 100-120 should be fine. Now we need an
exponential function of the priority to assign timeslices to try to
maintain interactivity. This should work :

#define TSDELTA (MAX_TIMESLICE - MIN_TIMESLICE)
#define KTSNORM (TSDELTA * TSDELTA * TSDELTA)

time_slice = MIN_TIMESLICE + (TSDELTA * prio * prio * prio) / KTSNORM;

Or something like :

static const short tsmap[] = {
10, 10, 10, 10, 10, 10, 10, 10, 10, 11,
11, 12, 13, 14, 15, 16, 17, 19, 20, 22,
24, 27, 29, 32, 35, 38, 42, 46, 50, 55,
60, 65, 70, 76, 82, 89, 96, 103, 111, 120,
};

This is a simple cubic, while a quadratic map looks like :

static const short tsmap[] = {
10, 10, 10, 10, 11, 11, 12, 13, 14, 15,
17, 18, 20, 22, 24, 26, 28, 30, 33, 36,
38, 41, 45, 48, 51, 55, 58, 62, 66, 70,
75, 79, 84, 88, 93, 98, 103, 109, 114, 120,
};

- Davide