qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual C


From: Hyman Huang
Subject: Re: [PATCH v10 3/3] cpus-common: implement dirty page limit on virtual CPU
Date: Wed, 15 Dec 2021 18:16:02 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2



在 2021/12/15 16:29, Hyman Huang 写道:


在 2021/12/15 16:09, Peter Xu 写道:
On Wed, Dec 15, 2021 at 03:56:55PM +0800, Hyman Huang wrote:
+{ 'command': 'vcpu-dirty-limit',
+  'data': { 'enable': 'bool',
+            '*cpu-index': 'uint64',
+            '*dirty-rate': 'uint64'} }

Drop @enable, please.

If @dirty-rate is present, set the limit to its value.

If it's absent, cancel the limit.

Ok. Indeed, this is the simplest style. :)

So the final qmp format should be like:

case 1: setup vcpu 0 dirty page limit 100MB/s
vcpu-dirty-limit  cpu-index=0   dirty-rate=100MB/s

case 2: cancle vcpu 0 dirty page limit
vcpu-dirty-limit  cpu-index=0

I actually agree with what you said... for human beings no one will read it as
"disable vcpu throttling", instead people could consider it enables vcpu
throttle with a default dirty rate from a gut feeling.

I think what Markus suggested is the simplest solution for computers, but it can confuse human beings.  So it turns out to be a general question to QMP scheme design: should we always assume QMP client to be a piece of software, or
should we still consider the feeling of human beings operating on QMP
interfaces using qmp-shell.

IMHO we should still consider the latter, if we don't lose much, anyway.  But I
don't have a strong opinion.
 > Thanks,

So, how do you think about it, Markus?

I prefer Peter's advice and there is another reason:

In current implementation, we introduced the global on/off switch,
enable dirty page rate limit on specified vcpu only if @cpu-index is passed, otherwise, all vcpu will be affected.

If we remove the @enable and use @dirty-rate to indicate the enabled/disable switch. The qmp format should be like the following:

case 1: setup vcpu 0 dirty page limit 100MB/s
vcpu-dirty-limit  cpu-index=0   dirty-rate=100MB/s

case 2: setup all vcpu dirty page limit 100MB/s
vcpu-dirty-limit dirty-rate=100MB/s

case 3: cancel vcpu 0 dirty page limit
vcpu-dirty-limit  cpu-index=0

case 4: cancel all vcpu dirty page limit
vcpu-dirty-limit

For case 4, it seems to be weired.

--
Best regard

Hyman Huang(黄勇)



reply via email to

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