Re: Don't save registers during system calls

Andi Kleen (ak@muc.de)
17 Apr 1998 12:26:07 +0200


Andreas Schwab <schwab@LS5.informatik.uni-dortmund.de> writes:

> H Peter Anvin <hpa@transmeta.com> writes:
>
> |>> H Peter Anvin <hpa@transmeta.com> writes:
> |>>
> |>> |>> FWIW, the m68k port already essentially does this. On kernel entry it
> |>> |>> only saves the registers that are call-clobbered in C (plus the registers
> |>> |>> that contain the syscall arguments so that they can be accessed through
> |>> |>> the normal C argument passing), the rest are only implicitly saved in the
> |>> |>> normal stack frames and during context switch. Since the m68k has many
> |>> |>> more registers than the ix86 this is a real win.
> |>> |>>
> |>>
> |>> |> 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.
> |>>
> |>> But that would only mean that you have to change the register allocation
> |>> in the compiler. Or do i miss something?
>
> |> So?
>
> In other words, it's not a real kernel issue.

You would have to change several assembler functions too, and possible global
register variable hacks (e.g. for current). But when m68k only saves
d0/d1/a0/a1 + arguments I doubt that it is worth the hazzle to tune that
further. On Merced it might become an issue.

-Andi

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