Messages in this thread | | | Date | Fri, 11 Feb 2005 02:09:10 -0700 | From | Tipp Moseley <> | Subject | Potential timer bug |
| |
Hello,
I am running on a uniprocessor x86 with CONFIG_SMP disabled and CONFIG_PREEMPT enabled.
The problem I have encountered is when using a timer in a module. The timer is set to execute every 3 ticks, and does nothing but increment a counter, and that works fine. However, when the module is unloaded sometimes the system hangs on module exit and barfs something like:
Unable to handle kernel paging request at virtual address e18861bc printing eip: c0122a88 *pde = 015e5067 *pte = 00000000 Oops: 0002 [#1] PREEMPT Modules linked in: yenta socket, rsrc_nonstatic sonypi CPU: 0 ... Call Trace: __do_softirq+0x76/0x90 do_softirq+0x41/0x50 ... <0>Kernel panic - not syncing: Fatal exception in interrupt
I am using del_timer_sync to delete the timer in the module_exit routine, and sometimes it works correctly. My theory is that since with CONFIG_SMP disabled, del_timer_sync is the same as del_timer. This allows the timer to potentially execute after the module has unloaded, causing the invalid paging request.
My solution to the problem (which works, but is probably not optimal) is to change '#ifdef CONFIG_SMP' to '#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)' around the code defining timer_del_sync. A patch is attached. Let me know if there's any more information that I can provide.
Thanks,
Tipp Moseley [unhandled content-type:application/octet-stream] | |