From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) Subject: Re: 0.97p2 Date: 28 Aug 1992 23:05:26 GMT
In article <1992Aug28.123817.20350@csd.uch.gr> kermits@pasifae.cc.uch.gr (Aggelos Keromyths) writes:
>I just tried 0.97p2 from the disk drive and it seemed to me a lot
> slower than 0.97 (no patch at all!!!)....When i did an `ls` it
> started reading the drive,then stopped,then again reading and finally
> presented the directory...but it was SLOW....
>What could be the problem ?
Hmm. I'd like to hear more about the problem - especially if you can
pinpoint it more closely (ie having used 0.97, 0.97.pl1 and now pl2) to
a specific patch. As most people said 0.97.pl1 was fast, I'm assuming
it's specific to patch2, but I'd like to have some confirmation before I
start looking into the problem.
If it's patch2, the problem is probably the changed mm code: having
different page tables for each process might be costlier than I thought.
The old (pre-0.97.pl2) mm was very simple and efficient - TLB flushes
happened reasonably seldom. With the new mm, the TLB gets flushed at
every task-switch (not due to any explicit flushing code, but just
because that's how the 386 does things when tasks have different cr3's).
I can optimize things a bit - it's reasonably easy to fake away some of
the TLB flushes by simply forcing the idle task to always use the same
cr3 as the last task did (as the idle task runs only in kernel memory,
and kernel memory is the same for all processes). So, I'd be interested
to hear if this simple patch speeds linux up at all:
- in linux/kernel/sched.c: schedule() - change
cli();
switch_to(next);
to
cli();
+ if (!next)
+ task[0]->tss.cr3 = current->tss.cr3
switch_to(next);
ie just add the one if-statement.
If the above makes a difference, I'd like to hear it, and I'll put it in
the standard kernel.
I'd also like to know what kind of machines the slowdown is most
noticeable on: assuming it's the mm changes I'd guess it's non-cached
machines (possibly SX-machines) for which a TLB flush will result in a
noticeable performance-loss. So if you notice a slowdown, please mail
me that kind of info as well.
Linus