RE: [PATCH] SN2 user-MMIO CPU migration

Chen, Kenneth W
2006-01-24T22:07:02Z

Luck, Tony wrote on Tuesday, January 24, 2006 1:51 PM
> > + .last_cpu = 0, \
>
> How does .last_cpu get propagated to new processes, and what is
> it initialized to? Right now it looks like there is an odd
> quirk that we'll call platform_switch_from() as each process starts
> running for the first time [or is the whole thread_info structure
> copied from the parent someplace that I didn't notice].

I think it is copy from dup_task_struct(): setup_thread_stack(tsk, orig)

and

void setup_thread_stack(struct task_struct *p, struct task_struct *org)
{
*task_thread_info(p) = *task_thread_info(org);
task_thread_info(p)->task = p;
}