Virtual Adress Space Reservation
Posted: Wed Feb 07, 2018 4:19 pm
First, let's call a reservation the initial allocation request from the client, when no mapping, PTE creating etc is involved, just reserving a piece of Virtual Address Space (VAS) for the future use, any - stacks placement, pools, image sections, file mapping, custom process entities.
What do you think is the best approach in VAS reservation. The client asks you to reserve a block of memory in its VAS, without address specified. Especially if you should care about a simultaneous possibility, that the client might ask to reserve at the specific address too, so for the algorithm, there is no guarantee that the space is split into 2 parts - purely empty and somewhat used.
I know about efficient lookups for already reserved blocks - keyed by addresses balanced/self-adjusting trees quickly answering whether this block is already reserved or not (and more answers in fact). But I don't see an effective means to quickly find an address for the reservation request.
Maybe on 48, 64 bits it's good to just move upwords all the way, it hardly would be exhausted anytime, but it's not the case for 32 bits.
What's your choice? Is it the same for the user space and kernel paged entities? I mean in kernel, one might do VA reservation somewhat hardcoded way. Is it good? It's not good for the trivially mapped MIPS's kseg0 for sure, but on the architectures, where mapping is always non-trivial (involving PTs) it might or might not be good. Honestly I don't see how hardcoded reservation in the kernel is good. Anyway, for the user space, there is no such a possibility, since a process could have maybe even thousands different reserved areas, they are too dynamic.
What do you think is the best approach in VAS reservation. The client asks you to reserve a block of memory in its VAS, without address specified. Especially if you should care about a simultaneous possibility, that the client might ask to reserve at the specific address too, so for the algorithm, there is no guarantee that the space is split into 2 parts - purely empty and somewhat used.
I know about efficient lookups for already reserved blocks - keyed by addresses balanced/self-adjusting trees quickly answering whether this block is already reserved or not (and more answers in fact). But I don't see an effective means to quickly find an address for the reservation request.
Maybe on 48, 64 bits it's good to just move upwords all the way, it hardly would be exhausted anytime, but it's not the case for 32 bits.
What's your choice? Is it the same for the user space and kernel paged entities? I mean in kernel, one might do VA reservation somewhat hardcoded way. Is it good? It's not good for the trivially mapped MIPS's kseg0 for sure, but on the architectures, where mapping is always non-trivial (involving PTs) it might or might not be good. Honestly I don't see how hardcoded reservation in the kernel is good. Anyway, for the user space, there is no such a possibility, since a process could have maybe even thousands different reserved areas, they are too dynamic.