Re: [PATCH 1/8] Notifier chain update

From: Alan Cox
Date: Wed Jan 18 2006 - 18:05:47 EST


On Mer, 2006-01-18 at 14:00 -0800, David S. Miller wrote:
> For example, IPV6 addresses can get added/removed from a device
> in response to packets, and these operations trigger the
> inet6addr_chain notifier in net/ipv6/addrconf.c
>
> So sleeping in a notifier is indeed illegal.

On the specific example yet. Notifiers get used for many things and
there has never been a rule about them not sleeping. There are lots of
cases where notifiers sleeping make sense including its early use in
power manglement.

Notifiers should not have locks. That was intentional in the original
implementation. You want locks, you implement them in the API *using*
the notifier, because its odds on you actually need to hold that lock
for other things too.

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