Re: Overscheduling DOES happen with high web server load.

Phillip Ezolt (ezolt@perf.zko.dec.com)
Thu, 6 May 1999 16:03:07 -0400 (EDT)


On Thu, 6 May 1999, Andrea Arcangeli wrote:

> On Wed, 5 May 1999, Phillip Ezolt wrote:
>
> Alt. Alpha uses HZ at 1024 so you get a scheduling rate by default 10
> times higher than in all other archs.

This is interesting. Is there any reason why alpha is at 1024?

>
> I think what we should do is to reschedule _only_ if a different process
> will be scheduled. What I consider oversheduling is to schedule() and then
> not switch to another task. Could you apply the patch below and run vmstat
> 1 again and see the rate of the overscheduling?

I changed your patch slightly, and ran the test again.
(Here's the new patch)

--- sched.c.orig Fri Apr 9 15:54:39 1999
+++ sched.c Thu May 6 13:37:08 1999
@@ -771,12 +771,16 @@
#ifdef __SMP__
sched_data->prev = prev;
#endif
- kstat.context_swtch++;
+ // kstat.context_swtch++;
get_mmu_context(next);
switch_to(prev,next);

__schedule_tail();
}
+ else
+ {
+ kstat.context_swtch++;
+ }

reacquire_kernel_lock(current);
return;

In any event, there is an HUGE amount of overscheduling going on.

As the test starts, it actually decreases. This makes sense, we are
actually running real things now, and not twiddling our thumbs in idle.

(Trimmed for brevity, but indicative...)

procs memory swap io system cpu
r b w swpd free buff cache si so bi bo in cs us sy id

0 0 0 0 226872 1544 9816 0 0 0 0 1099 39056 2 2 96
0 0 0 0 226872 1544 9816 0 0 0 0 1082 39054 1 2 96
0 0 0 0 226872 1544 9816 0 0 0 0 1079 39118 2 2 96
0 0 0 0 226872 1544 9816 0 0 0 1 1099 39116 2 2 96
0 30 0 0 224744 1616 9816 0 0 75 0 1519 35529 4 8 89
0 29 0 0 223120 1672 10376 0 0 451 0 1369 34011 6 8 86
0 30 0 0 221968 1744 10776 0 0 344 0 1370 32861 4 9 87
8 32 0 0 219312 1816 11208 0 0 399 0 1401 27527 6 10 84
0 37 0 0 216648 1864 11984 0 0 406 0 1516 22204 8 13 79
0 57 0 0 210360 1920 12944 0 0 643 0 1603 13209 14 18 68
4 85 0 0 198544 1976 14048 0 0 730 0 1774 7218 20 30 49
0 96 0 0 187520 2016 15176 0 0 743 0 1783 5522 20 34 47
0 93 0 0 175776 2048 16632 0 0 1156 14 1993 3728 22 42 37
0 96 0 0 173080 2088 18392 0 0 1388 6 2037 4427 14 33 53
0 89 0 0 171296 2128 20056 0 0 1365 3 2068 4655 12 34 54
0 92 0 0 169960 2160 21176 0 0 840 3 1971 4445 13 32 55
0 94 0 0 168320 2192 22720 0 0 1213 2 2036 4314 14 32 54
0 86 0 0 166584 2224 24256 0 0 1310 3 2158 4194 13 37 50
1 82 0 0 164504 2248 26144 0 0 1539 3 2250 3879 15 37 48
0 88 0 0 162992 2296 27488 0 0 1073 3 2232 3799 16 37 47
0 87 0 0 161264 2336 29128 0 0 1284 4 2356 4200 16 35 49
0 85 0 0 158936 2368 31136 0 0 1817 2 2230 4457 14 34 52
12 71 0 0 157096 2400 32632 0 0 1328 3 2304 3636 16 39 46
0 79 0 0 155168 2440 34464 0 0 1599 2 2351 3985 15 38 47
0 87 0 0 153432 2480 35840 0 0 1299 3 2291 3705 17 38 45
3 70 0 0 150880 2520 38088 0 0 1948 2 2416 4069 16 37 47
0 72 0 0 148496 2552 40336 0 0 2013 4 2731 3902 17 39 44
0 79 0 0 146976 2600 41720 0 0 1154 2 2626 3539 18 41 41
17 73 0 0 144952 2648 43704 0 0 1886 2 2445 3487 18 41 42
0 79 0 0 143056 2688 45464 0 0 1595 2 2211 3856 14 39 47
0 76 0 0 140192 2728 47920 0 0 2284 2 2880 3059 20 46 35
0 79 0 0 138832 2768 49224 0 0 1242 3 2442 3681 16 41 43
0 70 0 0 136288 2816 51544 0 0 2171 4 3014 3583 20 41 38
15 64 0 0 134432 2872 53176 0 0 1466 3 2875 3007 20 45 35
0 67 0 0 132448 2928 54984 0 0 1690 3 3134 2712 22 48 30
5 63 0 0 130704 2984 56656 0 0 1519 3 2825 3006 23 41 36
0 70 0 0 127936 3040 58952 0 0 2070 2 3159 2584 23 48 29
22 61 0 0 126096 3088 60688 0 0 1584 3 2932 2671 21 48 31

>
> If the rate is low there is no overscheduling and you should simply
> decrease HZ to spend less time in the scheduler.
>
> Andrea Arcangeli
>
>
> -
Is there any penalty for doing this?

--Phil

Digital/Compaq: HPSD/Benchmark Performance Engineering
Phillip.Ezolt@compaq.com ezolt@perf.zko.dec.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/