Re: rfc/rft: use r10 as current on x86-64
From: Benjamin LaHaise
Date: Tue Nov 22 2005 - 12:28:46 EST
On Tue, Nov 22, 2005 at 06:10:42PM +0100, Andi Kleen wrote:
> I think you could get most of the benefit by just dropping
> the volatile and "memory" from read_pda(). With that gcc would
> usually CSE current into a register and it would would work essentially
> the same way with only minor more .text overhead, but r10 would be still
> Unfortunately when that's done then the kernel doesn't boot.
> It's probably something silly, but i never had time to track it down.
> Might want to look into that?
Without even fixing it, the difference in kernel code size is still 20K
less than what using a register does. The benefit of using a register is
that accessing a field in current can simply offset the register, compared
to the pda usage that requires loading current into a register before the
offset is performed. Using 'size' on the resulting kernels shows:
text data bss dec hex filename
4132289 819632 317256 5269177 5066b9 vmlinux.orig
4119951 819632 317256 5256839 503687 vmlinux.non-volatile
4097300 819560 317256 5234116 4fddc4 vmlinux.r10
I think that using a register makes more sense given the benefits.
"Time is what keeps everything from happening all at once." -- John Wheeler
Don't Email: <dont@xxxxxxxxx>.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/