Re: Sleeping in init_module / cleanup_module

From: Tigran Aivazian (tigran@veritas.com)
Date: Fri Apr 07 2000 - 11:39:23 EST


On Fri, 7 Apr 2000, David Woodhouse wrote:

> I've just noticed that module->cleanup() is called in 2.3 with the unload_lock
> spinlock held.
>
> Does this mean it's no longer allowed to do anything which sleeps?
>
> (Like obtaining a semaphore so it can take itself off a driver list)

no, incorrect - before free_module() (which calls mod->cleanup()) is
called, the caller always unlocks the unload_lock spinlock before.

Otherwise, things liks usb/hub.c wouldn't work as it can sleep while
trying to kill the khubd kernel thread that it created in init.

Regards,
Tigran.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:18 EST