Re: Don't save registers during system calls

ralf@uni-koblenz.de
Fri, 17 Apr 1998 13:22:05 +0200


On Fri, Apr 17, 1998 at 10:29:00AM +0000, H. Peter Anvin wrote:

> That's not quite what he's proposing. You're just doing the same
> thing, it's just that the saves are later. I think he was proposing
> that the kernel use a smaller (clobbered) register set than user space
> would, hence (hopefully) not needing to save and restore some of the
> registers at all. Since the Alpha has many more registers than the
> m68k, this might be a win, too.

I've recently implemented this for MIPS weeks ago. Running on a Indy with
a 180MHz R5000SC this and some other changes brought the syscall latency
down from somewhat more than 1.1us to 861ns. In order to implement this
I have to take advantage of the MIPS calling conventions which say that
registers $s0 - $s8 are callee saved, so they will be unchanged without
saving them at all. The temporary registers $at, $t0 - $t9 are not being
saved at all for normal subroutine calls nor do the glibc stubs expect
them to be. So why the heck saving them? Finally there are do_signal,
sys_clone() and sys_fork() which expect to find the s-registers in the
stackframe, we just save the s-registers into the struct pt_regs on the
stack in those functions because we know that gcc hasn't changed them
yet ...

Ralf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu