2007/2/10, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx>:
Hi... Thanks for sharing your finding, I really appreciate it. In fact, this is a quite new information for me too since once I also thought it was safe to call printk() in *any* context.
Perfectly suitable for *any* context is not possible. But I think printk() is safe for most cases. After all, very very little piece of kernel code will hold run queue lock and that piece of code is seldom need to be debug.
Maybe this is an additional question, what function are we supposed to use to log message inside this kind of context? Let me guess, relayfs? Or... should we build netlink connection and use it to pipe the information to user space logger? Any inputs are greatly appreciated.
printk() is still my choice. But if I am not too hash, I sometimes create my own log buffer and copy logged message to the buffer in my own way, guaranteeing that no unexpected lock is held.
regards, Mulyadi -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/