Hi! On 12:06 Tue 08 Jan , Ender.Dai wrote: > Well, as we know, a function contains prolog and epilog. After > wake_up_interruptible(), the rmmod thread executes and frees the > memory of this module. At this time, memory containing epilog of the > my_task_routine() was freed, it may oops when those "epilog" execute > later on. Is this a trap? or do I make some mistakes? > > At last, many thanks for you to read my post, and any help will be appreciated. The timer function is executed in interrupt context. Calling wake_up_interruptable in the timer function may cause problems. On non-smp systems you do not need any synchronization. On smp machines you can try calling sleep ??ms (do not know if you can sleep in the module unload function) after stopping the timer and then unload. I know, this is dirty, but if the timer function is running, it will not be interrupted and rescheduled. -Michi -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.homelinux.net -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ