grow_protection_domain
should check for and reject requests to grow programs larger than that limit.
grow_protection_domain
should account for the possibility that the original allocation request (or previous additional allocation requests) for memory did not evenly fill up the previously allocated pages.
grow_protection_domain
should specify which MMU registers must be updated with new values, as well as which kernel data structures.
Here is an example energy analysis for a base-and-bounds design: For the specified modem speeds, downloading a 2K program takes 400 ms and thus consumes 1800 ma-seconds of battery capacity. Compacting all 30K of memory to make room for a new program would require no more than 15,000 iterations of a 4-instruction loop, and on average probably only half that, say 30,000 instructions. Assuming that an 8 MHz computer runs 3 MIPS, 30,000 instructions would require 10 ms of CPU and RAM time and would absorb no more than 80 ma-seconds of battery capacity. Thus, doing one compaction for every download would increase energy usage by less than 5%--probably much less, if the program runs for a significant length of time. A similar analysis suggests that if programs run more than 200 ms between calls to grow_protection_domain, one compaction per call would increase energy use by less than 5%.
Saltzer@mit.edu