buffers vs. pages vs. kernel speed

Matthias Urlichs (smurf@work.smurf.noris.de)
11 Jun 1997 09:36:00 +0200


I just started my news server up under 2.0.31.pre2.

Major performance ugliness. We saw 30 seconds to open a file in
control/cancel (admittedly a rather big directory).

The following patch brought performance back to 2.0.29 level, with an
average of 0.1 seconds to open a new spool file and 0.2 seconds in
control/cancel.

What this patch does is to try all methods of freeing memory in turn,
instead of trying one until it fails. swap_mmap() is too aggressive freeing
buffers since the average buffer is not touched often enough...

davem: This, or something like it, definitely needs to be in 2.0.31, at
least until the real reason why try_to_free_buffer() is so aggressive is
found.

cvs diff: Diffing .
Index: vmscan.c
===================================================================
RCS file: /usr/src/cvs/kernel/linux/mm/vmscan.c,v
retrieving revision 1.8
diff -u -r1.8 vmscan.c
--- vmscan.c 1997/05/19 21:23:07 1.8
+++ vmscan.c 1997/06/11 07:03:09
@@ -344,17 +344,17 @@
switch (state) {
do {
case 0:
+ state = 1;
if (shrink_mmap(i, dma))
return 1;
- state = 1;
case 1:
+ state = 2;
if (shm_swap(i, dma))
return 1;
- state = 2;
default:
+ state = 0;
if (swap_out(i, dma, wait))
return 1;
- state = 0;
i--;
} while ((i - stop) >= 0);
}

-- 
That girl at the end of the bar wants you to know that she doesn't want to
know you!
-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP Nürnberg 
Schleiermacherstraße 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 Nürnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42