[Top][All Lists]

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

Re: [PATCH v6 09/12] softmmu/physmem: Don't use atomic operations in ram

From: David Hildenbrand
Subject: Re: [PATCH v6 09/12] softmmu/physmem: Don't use atomic operations in ram_block_discard_(disable|require)
Date: Mon, 22 Feb 2021 14:33:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 22.02.21 14:14, Paolo Bonzini wrote:
On 22/02/21 12:57, David Hildenbrand wrote:

- * If positive, discarding RAM is disabled. If negative, discarding RAM is
- * required to work and cannot be disabled.
- */
-static int ram_block_discard_disabled;
+static unsigned int ram_block_discard_requirers;
+static unsigned int ram_block_discard_disablers;

Requirer is not an English word, so perhaps use required_cnt and

I did a internet search back then and was not completely sure if it's okay. See


for example (not 100% trustworthy of course).

No strong opinion on the name (required_cnt/disabled_cnt is clearer).

Also, uncoordinated require is unused, and therefore uncoordinated
disable is also never going to block anything.  Does it make sense to
keep it in the API?

Right, "ram_block_discard_require()" is not used yet. I am planning on using it in virtio-balloon context at some point, but can remove it for now to simplify.

ram_block_uncoordinated_discard_disable(), however, will block virtio-balloon already via ram_block_discard_is_disabled(). (yes, virtio-balloon is ugly)


David / dhildenb

reply via email to

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