On 30.10.2012 10:23, Maurizio Lombardi wrote: > On Mon, Oct 29, 2012 at 10:34 PM, Jiří Zárevúcky > <[email protected]> wrote: >> http://bazaar.launchpad.net/~zarevucky-jiri/helenos/golang/revision/1596 >> > > I'm curious if the guard pages can be created in a much more simpler > way in kernel/generic/mm/as.c > In the as_get_unmapped_area(): > > for (btree_key_t i = 0; i < node->keys; i++) { > as_area_t *area = (as_area_t *) node->value[i]; > > mutex_lock(&area->lock); > > -------> addr = > ALIGN_UP(area->base + P2SZ(area->pages), PAGE_SIZE); > bool avail = > ((addr >= bound) && (addr >= area->base) && > (check_area_conflicts(as, addr, pages, area))); > > mutex_unlock(&area->lock); > > if (avail) > return addr; > } > > --------------------- > addr = ALIGN_UP(area->base + P2SZ(area->pages) + PAGE_SIZE, PAGE_SIZE); > > It should leave an unmapped page beetween a two adiacent areas
There would still be a way to place the new area just below an already existing area without the gap in between. After a suitable area destroy or resize, it would be also possible to create yet another area that would be bordering with our new area from below, also without a gap. I am afraid we will need to literally allocate the gap so that it can't be filled accidentally. Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
