Re: [PATCH RFC 6/6] Implement "current" with the PDA.

From: Andi Kleen
Date: Sun Aug 27 2006 - 12:00:32 EST


On Sunday 27 August 2006 10:44, Jeremy Fitzhardinge wrote:
> Use the pcurrent field in the PDA to implement the "current" macro.
> This ends up compiling down to a single instruction to get the current
> task.
>
> The slightly tricky part about this patch is that cpu_init() uses
> current very early, before the PDA has been set up. In this instance,
> it uses current_thread_info()->task to get the current task.
>
> Also, the very early PDA set up for the boot cpu contains the initial
> task pointer so current works from a very early stage.

With that you could remove the code in do_IRQ now that setups up a fake thread_info
for interrupt stacks.

-Andi
-
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/