qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] Limiting coroutine stack usage


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] Limiting coroutine stack usage
Date: Tue, 6 Mar 2018 11:51:24 +0000
User-agent: Mutt/1.9.2 (2017-12-15)

On Tue, Feb 20, 2018 at 06:04:02PM +0100, Peter Lieven wrote:
> I remember we discussed a long time ago to limit the stack usage of all 
> functions that are executed in a coroutine
> context to a very low value to be able to safely limit the coroutine stack 
> size as well.
> 
> I checked through all functions in block/, migration/ and nbd/ and there are 
> only very few larger or unbound stack
> allocations that can easily be fixed.
> 
> Now my question: Is there an easy way to add a cflag like -Wstack-usage=2048 
> to all objects in a given directory only?
> I tried to add a llimit to the whole project, but fixing this will be a 
> larger task.

2KB is fine for QEMU code but actual coroutine stack sizes will have to
be at least 8KB, I guess, in order for third-party libraries to work
(e.g. curl, rbd).  PATH_MAX is 4KB on Linux.

Nested event loops in QEMU code can also result in deep call stacks.
This happens when aio_poll() invokes an fd handler or BH that also
invokes aio_poll().

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]