Skip to contentSkip to conversation

Why isn't there a unregister_die_notifier?

QUESTION Andi Kleen 2 participants 2 messages Aug 18, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1124377142.5186.45.camel@localhost.localdomain.suse.lists.linux.kernel

Andi Kleen

author
#1 lore raw
Quoted 8 lines · Steven Rostedt

Hi, I have a debugging module that I want to register a die notifier. But I just noticed that I can't unregister it. So for now I either just keep the module loaded and never unloaded it, compile it into the kernel, or ifdef out the register_die_notifier when loaded as a module.

Is there some reason that there isn't such a call, or maybe there is, and I don't see it (called something else). Or is this something that should be added?

I didn't add one original because unloading debuggers is very tricky. There is no locking and no reference counting and they can be entered in any context. Adding it would require some RCU tricks at least and might still have some non trivial races.

-Andi

#2 lore raw
Quoted 7 lines · Andi Kleen
Quoted 5 lines · Steven Rostedt

Hi, I have a debugging module that I want to register a die notifier. But I just noticed that I can't unregister it. So for now I either just keep the module loaded and never unloaded it, compile it into the kernel, or ifdef out the register_die_notifier when loaded as a module.

Quoted 8 lines
Quoted 3 lines

Is there some reason that there isn't such a call, or maybe there is, and I don't see it (called something else). Or is this something that should be added?

I didn't add one original because unloading debuggers is very tricky. There is no locking and no reference counting and they can be entered in any context. Adding it would require some RCU tricks at least and might still have some non trivial races.

Yeah, I use macros to call all the debugger code and spinlocks to protect them. The macros change when the module is built into the kernel to not do any protection, since it isn't needed. It's not the most efficient thing, and RCU would probably be better. But I can insert and remove this module over and over with the debugging going on, and it hasn't broke yet. But I guess, I'll just do without for now.

-- Steve