Re: [Qemu-devel] [PATCH 01/15] coroutine-ucontext: mmap stack memory

2016-06-28 Thread Paolo Bonzini
On 28/06/2016 11:01, Peter Lieven wrote: > +#ifdef MAP_GROWSDOWN > +co->stack = mmap(NULL, COROUTINE_STACK_SIZE, PROT_READ | PROT_WRITE, > + MAP_PRIVATE | MAP_ANONYMOUS | MAP_GROWSDOWN, -1, 0); > +if (co->stack == MAP_FAILED) { > +abort(); > +} > +/* ad

Re: [Qemu-devel] [PATCH 01/15] coroutine-ucontext: mmap stack memory

2016-06-28 Thread Peter Lieven
Am 28.06.2016 um 12:02 schrieb Peter Maydell: On 28 June 2016 at 10:01, Peter Lieven wrote: coroutine-ucontext currently allocates stack memory from heap as on most systems the stack size lays below the threshold for mmapping memory. This patch forces mmaping of stacks to avoid large holes on

Re: [Qemu-devel] [PATCH 01/15] coroutine-ucontext: mmap stack memory

2016-06-28 Thread Peter Maydell
On 28 June 2016 at 10:01, Peter Lieven wrote: > coroutine-ucontext currently allocates stack memory from heap as on most > systems the > stack size lays below the threshold for mmapping memory. This patch forces > mmaping > of stacks to avoid large holes on the heap when a coroutine is deleted.

[Qemu-devel] [PATCH 01/15] coroutine-ucontext: mmap stack memory

2016-06-28 Thread Peter Lieven
coroutine-ucontext currently allocates stack memory from heap as on most systems the stack size lays below the threshold for mmapping memory. This patch forces mmaping of stacks to avoid large holes on the heap when a coroutine is deleted. It additionally allows us for adding a guard page at the