Dear Jiri Z.,
Author: Jiří Zárevúcky <[email protected]> Date: 2023-02-10T16:18:53+01:00 SHA1: daadfa699247351099d4c91048e2f9e9a29c346a URL: https://github.com/HelenOS/helenos/commit/daadfa699247351099d4c91048e2f9e9a29c346a Message: Remove unnecessary context field from cpu_t structure
I'm not confident that this change is a good idea. Both the main_ap() and the scheduler() functions run on a "borrowed stack", so to speak. In other words, they have very little control over the stack configuration. Therefore it makes sense to limit their own stack usage to bare minimum in order to avoid stack overflow.
The size of context_t might not be trivial on some platforms and therefore it makes sense to have it in a fixed location that is guaranteed to be always available instead of placing it on the stack in this unusual situation.
I have no doubt that you have actually tested your change on all architectures, but it is still that kind of code where I would happily trade the certain amount of "potentially wasted memory" for being sure that there cannot be any surprises.
If I can suggest an alternative approach, how about implementing an elegant way to switch to the separated stack without the need for the entire context_t?
M.D. _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
