Re: [patch] releasing kernel lock during copy_from/to_user

Manfred Spraul (manfreds@colorfullife.com)
Mon, 24 May 1999 14:41:41 +0200


This is a multi-part message in MIME format.
--------------F016E5B20AF0D24DC834710B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've downloaded 2.3.3-andrea4.bz2, and collected some statistics.
Dual PII-350, 100 MHz memory bus.

1) serving 1 131 byte file over the network.
- 2.2.9: kernel_lock acquired 1.7 Million times.
the statistics have 2 maximums: one around 512 ticks,
another around 2048 ticks.
- andrea: lock: 2.7 million times
strong maximum at less then 128 ticks.

andrea is around 5 % slower than the original 2.2.9

2) serving 1 6 kB file (no network, client & server on the same
computer)
- 2.2.9: lock: 600.000
2 max at 512 & 2048
- andrea: 1.2 million locks
max at < 128 ticks, a small max at 512.
no noticable speed difference.

3) serving 1 100 kB file (client & server on the same computer)
- 2.2.9: 300.000 kernel-lock's
no clear max, one weak max at 2048
- andrea: 1.5 million.
max at ~ 400 ticks
andrea was ~ 20% faster (2.2.9: 28 MByte/s transfer, andrea: 35)

I've attached the logs for 100kB.
The list is an array of kernel-lock ownership-times.
Every slot stands for 128 ticks.
This routine adds an overhead of ~ 130 ticks to every kernel-lock,
so the first slot is always empty.

The maximum at less than 128 ticks for the 131 byte file clearly shows
that we should not release the lock unless we assume that we don't
need the lock for a longer time.

Manfred
--------------F016E5B20AF0D24DC834710B
Content-Type: text/plain; charset=iso-8859-1;
name="2.2.9-NW"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="2.2.9-NW"

200 clients for 100 seconds reading a 131 byte file with apache-1.3.6
-2.2.9-
kernellockstat: shift 0(was 7), overflows 165269.
0 16d 191 f97c 1d3a6 721d 4367 8fe1 8464 a50d b2c1 6a95 fdef ec84 132ee e=
339 8dde 10574 a49e 7c88 6fe5 638e 57d0 52ab 4caf 5096 5698 4e1b 4052 3bf=
f 41d7 4c27 524d 5600 66d6 8021 924e ab8b ad5c 91a7 75b7 5a04 43f5 37e0 2=
f58 2a66 285a 26eb 2497 24bd 2531 251f 254a 235e 1f42 1d90 1d36 1f71 2201=
2676 2cbd 3410 3522 2e66 2570 1d27 17b8 1564 1495 131e 10ff f63 dc6 db2 =
d30 d6e df1 d98 d39 e0a dca d2b c44 b09 953 803 64c 526 405 345 2af 26c 2=
0b 1d2 1b2 191 171 150 177 13c 166 140 155 147 14b 12d fb 102 fc df de c9=
d1 e8 d6 c9 d4 ae c5 cb bf bb bc b4 be bc d1 c7 c5 bb b7 ab aa ca b3 a3 =
af 93 bb bb b2 a1 a4 d2 a1 be bb a9 aa be c1 c0 de f0 d3 e8 ec 102 11a 15=
6 1b2 217 252 282 29a 2bb 29c 284 25a 24d 215 20f 1e8 1df 1db 1c5 1b3 19c=
167 1a7 174 139 127 106 10d 111 fe e3 f5 d9 c2 ba bc a6 d7 bf c0 bf ce b=
4 a8 9d a1 bc d9 d0 b3 d3 c3 98 c8 94 9d ae 90 8e 8c af a1 a7 9b 9e 9c b4=
ad a6 a8 a4 a8 b8 9f b4 a8 c5 c4 ba b3 c8 b5 b4 d2 a3 b3 ae 9b ba a4 a3 =
b5 a7 b1 a8 a8 a6 95 88 =

Sum: 1793872

--------------F016E5B20AF0D24DC834710B
Content-Type: text/plain; charset=iso-8859-1;
name="2.3.3-andrea4-NW"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="2.3.3-andrea4-NW"

200 clients for 100 seconds reading a 131 byte file with apache-1.3.6
-ANDREA-
kernellockstat: shift 0(was 7), overflows 180594.
0 628a8 3dd0d 374bd 1cf55 77ae 5bab 10032 14304 208d5 15b0d 15f0d 953d 81=
c3 ae98 b8ef b3f1 bb0a b54e 9bf6 823f 712a 67ad 5b89 51b9 4c9f 56fc 6550 =
60df 52dd 48c4 4489 5745 835d 8467 7090 6e1a 87da 9773 878b 7124 6416 56e=
c 494a 3c51 354e 31c4 2f8c 2da9 2b7a 2783 2278 1d9c 18a1 145b 1070 ec7 d4=
c cd5 c9a c70 c8e d67 d65 dec ea0 f86 1020 10ef 1065 fad ea9 c84 af1 a11 =
94d 890 864 87d 7a0 76f 6a6 63e 5f2 543 4d0 441 3d2 370 29e 268 1fd 200 1=
b3 198 1a5 163 17a 143 131 10f 116 113 11a f0 db fd e8 107 112 104 100 e4=
ff f5 ff 105 fd e3 100 ff fb e2 f9 e2 eb cb d3 f9 d8 e1 108 e4 f5 f9 10d=
f4 107 f8 11c 101 109 f1 10d 104 fd ff ff ec fb cd 101 e5 105 120 14d 13=
8 159 162 17d 1ee 24c 285 300 326 34d 334 336 363 354 390 36f 36f 326 2fd=
2d2 277 247 1fd 1df 19c 196 16e 152 11b ff ed d6 e1 d3 bb cd df de dd d3=
da ea cf dd c5 ca c7 bf c7 be cd b9 a9 b6 95 a7 8c 8a 98 86 92 8d a1 a1 =
80 7a 86 81 8a 73 87 85 85 79 79 8c 79 8c 76 79 70 7f 74 7a 7f 7e 76 6c 7=
5 79 86 84 74 76 8d 6e 77 7d 79 7f =

Sum: 2751462

--------------F016E5B20AF0D24DC834710B
Content-Type: text/plain; charset=iso-8859-1;
name="2.2.9-local-100kB"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="2.2.9-local-100kB"

200 clients (on the same computer) reading a 100 kB file.
(20 seconds)
-2.2.9-
kernellockstat: shift 0(was 7), overflows 31221.
0 10 49 f85 1157 1166 b5a b35 c4f 118d b76 1280 152f d42 7c6 16f5 11eb dd=
5 926 809 6e3 69a 605 5ff 561 5aa 5d8 628 643 6b1 61e 590 54d 52e 4b7 447=
3b7 3ae 396 395 3e7 40c 457 46f 4f8 515 524 59b 802 a1c 974 7d2 640 56e =
648 72b 751 66e 5db 533 508 52e 538 563 588 609 5e4 558 539 539 4eb 55d 5=
78 57e 559 523 527 512 4d2 480 4aa 4dc 48f 4d6 49d 468 4d2 4c8 4c4 4b5 4a=
f 4b9 465 44d 450 407 42e 3a7 3b4 3c1 3ec 3aa 38b 3b9 37d 357 2fc 355 314=
30e 31b 360 381 386 39b 377 3af 399 3c3 3bc 3b3 398 3ac 3ca 36d 36e 376 =
34f 378 394 399 3cf 3e2 42e 472 48f 429 449 408 3f6 39f 3f7 35f 37d 363 3=
2e 338 317 2fd 2f6 315 310 326 36f 355 350 36c 3b1 37f 3c1 3ca 3b0 38d 3e=
a 3b2 3a8 37f 360 394 31e 358 349 335 2dd 2c2 2bb 2a8 24a 268 258 237 1e4=
23b 232 220 20b 21e 222 236 24c 270 2a0 287 292 270 268 24c 218 21e 208 =
1fd 1e5 1cc 1cd 1b3 17c 163 16b 142 135 14d 123 126 134 119 140 115 143 1=
34 114 11d 12a 12e 13c 129 116 117 106 109 104 108 f1 e9 d5 f6 ff 119 10d=
108 f8 10c 111 103 106 11f 116 122 120 10e 134 e5 104 ff d6 f3 ea =

Sum: 270817

--------------F016E5B20AF0D24DC834710B
Content-Type: text/plain; charset=iso-8859-1;
name="2.3.3-andrea4-local-100kB"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="2.3.3-andrea4-local-100kB"

200 clients (on the same computer) reading a 100 kB file.
(20 seconds)
-andrea-
kernellockstat: shift 0(was 7), overflows 17601.
0 b305 9727 1c944 182b1 2930f 1b67d a70b 8d94 99c9 9ac0 8f03 737e 6e3c 89=
9a aef5 c687 c918 cac4 ac1f 7ea5 60ee 5274 4cf1 42c7 34f9 292c 22a4 23d4 =
270d 2d35 3160 2ec0 2888 27eb 2890 2508 23dd 21ae 1f11 1cca 1a89 1a59 19a=
a 1843 1529 13b4 12c4 1241 138b 1436 12f2 1010 d80 c90 c19 bd3 af3 960 91=
8 879 801 769 74d 798 8d6 99d 9b4 913 833 7b9 72e 72c 6fb 7a0 7d2 807 7fe=
802 854 862 8a2 89c 886 892 899 8fb 8ae 83c 73d 654 6ad 649 62a 5b4 53a =
484 411 3b7 36b 31b 31c 2f7 2c7 2b3 286 288 252 263 278 23a 235 215 1dc 1=
d4 1f6 1e1 1bc 1bb 1c8 1af 1ac 192 1bb 1b2 196 182 1b2 19f 18e 175 16f 19=
3 166 170 160 14e 155 164 15e 166 18d 191 186 185 15b 16a 14d 148 159 15d=
13e 173 1a1 1ad 1a0 19c 19c 191 15d 189 18b 151 17f 159 14d 14b 133 12f =
10e ff 109 fa fc ed f5 f3 f6 d4 d4 a9 97 91 8f 6f 96 70 67 7e 5f 61 71 5a=
53 58 61 4f 54 5b 50 4d 5e 50 65 61 67 6b 61 5d 4a 4e 54 42 46 3c 33 36 =
3b 38 26 33 39 2f 3b 34 36 3e 3d 35 34 32 27 1f 1f 28 1b 2e 19 1f 25 20 1=
e 26 2a 1e 33 36 30 31 35 38 40 44 44 4c 3c =

Sum: 1589585

--------------F016E5B20AF0D24DC834710B--

-
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/