qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 6/7] util/oslib-posix: Support concurrent os_mem_prealloc(


From: David Hildenbrand
Subject: Re: [PATCH v3 6/7] util/oslib-posix: Support concurrent os_mem_prealloc() invocation
Date: Tue, 28 Sep 2021 19:17:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 28.09.21 18:56, Daniel P. Berrangé wrote:
On Mon, Aug 16, 2021 at 11:47:38AM +0200, David Hildenbrand wrote:
Add a mutex to protect the SIGBUS case, as we cannot mess concurrently
with the sigbus handler and we have to manage the global variable
sigbus_memset_context. The MADV_POPULATE_WRITE path can run
concurrently.

Note that page_mutex and page_cond are shared between concurrent
invocations, which shouldn't be a problem.

This is a preparation for future virtio-mem prealloc code, which will call
os_mem_prealloc() asynchronously from an iothread when handling guest
requests.

Add a comment that messing with the SIGBUS handler is frowned upon and
can result in problems we fortunately haven't seen so far. Note that
forwarding signals to the already installed SIGBUS handler isn't clean
either, as that one might modify the SIGBUS handler again.

Even with the mutex, messing with SIGBUS post-startup still isn't safe
as we're clashing with SIGBUS usage in softmmu/cpus.c

You raise a valid point, though: this node is stale (there is no such comment) and shall be removed :)

Thanks!

--
Thanks,

David / dhildenb




reply via email to

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