Serge E. Hallyn wrote:As far as I can see, there isn't an inherent reason not to handle kernel threads. However, I never looked deep into the problem. The main issue that I can see with it is similar to what the hibernation developers must tackle anyway - how to freeze kernel threads when some of them may still be needed to take the system down. Assuming that is solved, then we're left with how to freeze the kernel threads in a state that makes sense for a restart; for regular tasks this is right before going back to user-land (*), for kernel threads it may not be the best place :) (*) however, tasks that are ptraced or in the middle of a vfork will require special treatment - since upon freezing they cannot be forced to that convenient position; so upon restart there must be special code to make their behavior after restart compatible with what they would have done originally - probably by emulation as opposed to rebuilding their old kernel stack. For instance, if a task was stopped due to ptrace before return from a syscall, then upon restart it should return to that exact state. So I'd assume that kernel threads could be treated in a similar manner by special-casing, if necessary. Question: I'd assume that at least for some of the kernel threads a simple re-launch at restart will do; how many really require that we save and restore their state ? Oren --
