That is a fine workaround for the structs being separate. But why not keep all the data in one struct on the kernel stack, like it was done in 2.4?
task_struct is huge. it's around 1,7KB on a 32 bit machine. on the other hand, you can easily see that thread_info is much slimmer. kernel stack is either 4 or 8KB, and either way a 1.7KB is pretty much, so storing a slimmer struct, that points to task_struct, immediately saves a lot of stack space and is a scalable solution.
-- 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/