Re: [BUG] mm_struct leak on cpu hotplug (s390/ppc64)

From: Heiko Carstens
Date: Wed Jan 05 2005 - 09:23:51 EST


> the correct solution i think would be to call back into the scheduler
> from cpu_die():
>
> void cpu_die(void)
> {
> if (ppc_md.cpu_die)
> ppc_md.cpu_die();
> + idle_task_exit();
> local_irq_disable();
> for (;;);
> }
>
> and then in idle_task_exit(), do something like:
>
> void idle_task_exit(void)
> {
> struct mm_struct *mm = current->active_mm;
>
> if (mm != &init_mm)
> switch_mm(mm, &init_mm, current);
> mmdrop(mm);
> }
>
> (completely untested.) This makes sure that the idle task uses the
> init_mm (which always has valid pagetables), and also ensures correct
> reference-counting. Hm?

Looks good and works for me.

Thanks,
Heiko

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