Re: Why is get_current() not const function?

From: Andi Kleen (ak@suse.de)
Date: Thu Mar 13 2003 - 08:31:50 EST


Jakub Jelinek <jakub@redhat.com> writes:

> E.g. on x86-64,
> NEW_AUX_ENT(AT_UID, (elf_addr_t) current->uid);
> NEW_AUX_ENT(AT_EUID, (elf_addr_t) current->euid);
> NEW_AUX_ENT(AT_GID, (elf_addr_t) current->gid);
> NEW_AUX_ENT(AT_EGID, (elf_addr_t) current->egid);
> results in 4 movq %gs:0,%rax instructions while one is completely
> enough.
> Anyone remembers why get_current function (on arches which define
> current to get_current()) is not const and why on x86-64

I tried it once. Then spent a day in fixing all the obvious problems
(addings lots of compile barriers to early bootup and the scheduler
to make it boot again etc.)

In the end I gave up because there were some weird crashes left
and I ran out of time on this one.

Feel free to retry it, but it'll be lots of work I suspect.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Mar 15 2003 - 22:00:35 EST