The Linux recycle of __init memory comes from a time where memory was a bit tighter. Also, there are companies running Linux on devices where memory is very tight. We are talking about different things here though. I was not suggesting we do the discard of __init memory like Linux does. But the multiboot memory where the command line resides, is overwritten as soon as Akaros starts. This is why I had to copy it out immediately wihtin kernel_init, to a safe BSS buffer.
On Tue, Nov 10, 2015 at 8:17 AM, ron minnich <[email protected]> wrote: > apropos the no plans to free boot memory comment, here's a reason. I found > a very nice case recently in linux where a pointer to free memory was being > used. I suspect these are more common than we can know. I also suspect new > such cases are generated over time. > > There are cases where freeing that little bit of memory makes a lot of > sense, but I doubt they fit the Akaros use case. > > This being C, where you never know where your pointers are sleeping at > night, the only reasonable thing I can think of for boot memory would be to > make it page-aligned, page-sized, and blow the PTEs away for it when done > booting, so you can catch attempts to use it later. Or, just accept that > you'll never get to use the 4M you can save by freeing it, and treat it > like any other statically initialized variable you get to use for any > purpose. > > 4M? it's a rounding error in the GNU runtime alone :-) > > ron > > -- > You received this message because you are subscribed to the Google Groups > "Akaros" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
