Re: [PATCH] Register atomic_notifiers in atomic context

From: Andrew Morton
Date: Thu Feb 23 2006 - 14:05:45 EST


Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>
> The calls to register_cpu_notifier are harder. That chain really does
> need to be blocking

Why?

> which means we can't avoid calling down_write. The
> only solution I can think of is to use down_write_trylock in the
> blocking_notifier_chain_register and unregister routines, even though
> doing that is a crock.
>
> Or else change __down_read and __down_write to use spin_lock_irqsave
> instead of spin_lock_irq. What do you think would be best?

Nothing's pretty. Perhaps look at system_state and not do any locking at all
in early boot?

> > I'd suggest that in further development, you enable might_sleep() in early
> > boot - that would have caught such things..
>
> Not a bad idea. I presume that removing the "system_state ==
> SYSTEM_RUNNING" test in __might_sleep will have that effect?

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