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
disabled_cnt?
I did a internet search back then and was not completely sure if it's
okay. See
https://en.wiktionary.org/wiki/requirer
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)
--
Thanks,
David / dhildenb