Discussion:
call_usermodehelper from a timer function ?
Indraneel Mukherjee
2005-11-16 11:04:34 UTC
Permalink
Hi All,
I've got a doubt regarding the call to call_usermodehelper.
Can i invoke it from a timer function? One of the recent thread's on
this mailing list suggest that we can call it from module_init(to get
a process context). But i read somewhere that the process context for
call_usermodehelper is obtained by creating a thread from the
kernel-event daemon. If that is the case, can i invoke
call_usermodehelper from a timer function?

Thanks and Regards,
Indraneel

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
Arjan van de Ven
2005-11-16 12:23:11 UTC
Permalink
Post by Indraneel Mukherjee
Hi All,
I've got a doubt regarding the call to call_usermodehelper.
Can i invoke it from a timer function? One of the recent thread's on
this mailing list suggest that we can call it from module_init(to get
a process context). But i read somewhere that the process context for
call_usermodehelper is obtained by creating a thread from the
kernel-event daemon. If that is the case, can i invoke
call_usermodehelper from a timer function?
call_usermodehelper has to be called from process context. Timer
functions aren't, so no you can't do that.
What you can do is schedule an event and have that event call it
instead.



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
Indraneel Mukherjee
2005-11-16 12:49:32 UTC
Permalink
Post by Arjan van de Ven
Post by Indraneel Mukherjee
Hi All,
I've got a doubt regarding the call to call_usermodehelper.
Can i invoke it from a timer function? One of the recent thread's on
this mailing list suggest that we can call it from module_init(to get
a process context). But i read somewhere that the process context for
call_usermodehelper is obtained by creating a thread from the
kernel-event daemon. If that is the case, can i invoke
call_usermodehelper from a timer function?
call_usermodehelper has to be called from process context. Timer
functions aren't, so no you can't do that.
What you can do is schedule an event and have that event call it
instead.
Not very clear about wat you mean by "schedule an event". Can you
write just a line or two giving some pointers in that direction (like
which kernel API's) ?

Thanks,
Indraneel
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
Arjan van de Ven
2005-11-16 12:58:46 UTC
Permalink
Post by Indraneel Mukherjee
Post by Arjan van de Ven
Post by Indraneel Mukherjee
Hi All,
I've got a doubt regarding the call to call_usermodehelper.
Can i invoke it from a timer function? One of the recent thread's on
this mailing list suggest that we can call it from module_init(to get
a process context). But i read somewhere that the process context for
call_usermodehelper is obtained by creating a thread from the
kernel-event daemon. If that is the case, can i invoke
call_usermodehelper from a timer function?
call_usermodehelper has to be called from process context. Timer
functions aren't, so no you can't do that.
What you can do is schedule an event and have that event call it
instead.
Not very clear about wat you mean by "schedule an event". Can you
write just a line or two giving some pointers in that direction (like
which kernel API's) ?
schedule_work() and friends should be the right API


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/

Loading...