qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tao Xu <tao3.xu@intel.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "lvivier@redhat.com" <lvivier@redhat.com>,
	"thuth@redhat.com" <thuth@redhat.com>,
	"ehabkost@redhat.com" <ehabkost@redhat.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"sw@weilnetz.de" <sw@weilnetz.de>, "Du, Fan" <fan.du@intel.com>,
	"mdroth@linux.vnet.ibm.com" <mdroth@linux.vnet.ibm.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
	"imammedo@redhat.com" <imammedo@redhat.com>,
	"Liu, Jingqi" <jingqi.liu@intel.com>
Subject: Re: [PATCH v17 01/14] util/cutils: Add Add qemu_strtold and qemu_strtold_finite
Date: Wed, 27 Nov 2019 15:22:56 +0800	[thread overview]
Message-ID: <a96d3d0b-bcb1-937b-419c-89201213a94d@intel.com> (raw)
In-Reply-To: <874kyplsy0.fsf@dusky.pond.sub.org>

On 11/27/2019 2:44 PM, Markus Armbruster wrote:
> Tao Xu <tao3.xu@intel.com> writes:
> 
>> On 11/26/2019 9:54 PM, Markus Armbruster wrote:
>>> Tao Xu <tao3.xu@intel.com> writes:
>>>
>>>> Hi Markus,
>>>>
>>>> Do you have any comments on this patch and 02/14 05/14 06/14.
>>>> Thank you!
>>>
>>> These provide a new QAPI built-in type 'time'.  It's like 'uint64' with
>>> an implied nanoseconds unit, and additional convenience syntax in the
>>> opts visitor and the keyval qobject input visitor.  Patterned after
>>> 'size'.
>>>
>>> The only use of 'time' so far is member @latency of NumaOptions member
>>> @hmap-lb.  Uses of that:
>>>
>>> * QMP command set-numa-node
>>>
>>>     The convenience syntax does not apply, as QMP uses the regular qobject
>>>     input visitor, not the keyval one.
>>>
>>> * CLI option -numa
>>>
>>>     We first parse the option argument with QemuOpts, then convert it to
>>>     NumaOptions with the opts visitor.
>>>
>>>     The new built-in type 'time' gets used in -numa hmat-lb,...,latency=T
>>>
>>> Questions / observations:
>>>
>>> * The keyval qobject input visitor's support for 'time' appears to be
>>>     unused for now.
>>>
>>> * What's the anticipated range of values for -numa
>>>     hmat-lb,...,latency=T?  I'm asking because I wonder whether we really
>>>     need convenience syntax there.
>>>
>>> * Sure you want fractions?
>>>
>>>     Supporting fractions for byte counts (e.g.  1.5G) has been a mixed
>>>     blessing, to put it charitably.
>>>
>>>     Use of fractions that aren't representable as double is not advisable.
>>>     For instance, 1.1G is 1181116006 bytes rounded from
>>>     1181116006.4000001.  Why would anybody want that?
>>>
>>>     Use of "nice" fractions is unproblematic, but the additional
>>>     convenience is rather minor.  Is being able to write 1536M as 1.5G
>>>     worth the trouble?  Meh.
>>>
>>>     With "metric" rather than "binary" suffixes, fractions provide even
>>>     less convenience: 1.5ms vs. 1500us.
>>>
>>>     The implementation is limited to 53 bits of precision, which has been
>>>     a source of confusion.  Even that has arguably taken far more patches
>>>     than it's worth.  We're now talking about more patches to lift the
>>>     restriction.  Meh.
>>>
>>>     What exactly are we trying to achieve by supporting fractions?
>>>
>>> * What about all the other time-valued things in the QAPI schema?
>>>
>>>     There are many more, and some of them are also visible in CLI or HMP.
>>>     By providing convenience syntax for just -numa hmat-lb,...,latency=T,
>>>     we create inconsistency.
>>>
>>>     To avoid it, we'd have to hunt down all the others.  But some of them
>>>     aren't in nanoseconds.  Your new built-in type 'time' is only
>>>     applicable to the ones in nanoseconds.  Do we need more built-in
>>>     types?
>>>
>>> This series is at v17.  I really, really want to tell you it's ready for
>>> merging.  But as you see, I can't.
>>>
>>> Maybe the convenience syntax is a good idea, maybe it's a bad idea.  But
>>> it's definitely not a must-have idea.
>>>
>>> If you want to pursue the idea, I recommend to split this series in two:
>>> one part without the convenience, and a second part adding it.
>>> Hopefully, we can then merge the first part without too much fuss.  The
>>> second part will have to deal with the questions above.
>>>
>>> You can also shelve the idea, i.e. do just the first part now.  It's
>>> what I'd do.
>>>
>> Thank you for your suggestion and support! Considering ACPI HMAT can
>> only store unsigned integer data, and for the memory latency
>> nanoseconds is enough. So we can use integer for latency data. I am
>> wondering if we can use this solution:
>>
>> * Still add builtin type time, but use qemu_strtou64() to parse.
>> * Still refactor do_strtosz() to support suffixes list, but add a
>> extra parameter to decide use qemu_strtou64() or qemu_strtod_finite(),
>> so time use qemu_strtou64() and qemu_strtod_finite()
> 
> We'd still have to grapple with "What about all the other time-valued
> things in the QAPI schema?"
> 
>> * Second part dealing with the questions.
>>
>> Then the only influence on HMAT patch is we need add a comments to
>> tell user to input integer.
> 
> Considerung we're already at v17, I recommend to keep the first part as
> focused as possible.  Since plain integer types are good enough for time
> values elsewhere in our external interfaces, they'll do for HMAT
> latency, too.
> 
> Once the first part is accepted, you're free to tackle the wider problem
> of providing convenience syntax for time values.  Fair warning: I
> consider this a swamp.
> 

Thank you! I will use integer for HMAT latency and submit the first part 
in next version.


  reply	other threads:[~2019-11-27  7:24 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  7:48 [PATCH v17 00/14] Build ACPI Heterogeneous Memory Attribute Table (HMAT) Tao Xu
2019-11-22  7:48 ` [PATCH v17 01/14] util/cutils: Add Add qemu_strtold and qemu_strtold_finite Tao Xu
2019-11-25  1:05   ` Tao Xu
2019-11-26 13:54     ` Markus Armbruster
2019-11-27  4:37       ` Tao Xu
2019-11-27  6:44         ` Markus Armbruster
2019-11-27  7:22           ` Tao Xu [this message]
2019-11-25  6:45   ` Markus Armbruster
2019-11-22  7:48 ` [PATCH v17 02/14] util/cutils: Use qemu_strtold_finite to parse size Tao Xu
2019-11-25  6:56   ` Markus Armbruster
2019-11-26  8:31     ` Tao Xu
2019-11-26  9:33       ` Markus Armbruster
2019-11-22  7:48 ` [PATCH v17 03/14] util/cutils: refactor do_strtosz() to support suffixes list Tao Xu
2019-11-25  7:20   ` Markus Armbruster
2019-11-25 12:15     ` Eduardo Habkost
2019-11-26 10:04       ` Markus Armbruster
2019-11-26 10:33         ` Daniel P. Berrangé
2019-11-26 12:37           ` Markus Armbruster
2019-11-26 15:46         ` Eduardo Habkost
2019-11-26 10:27   ` Markus Armbruster
2019-11-22  7:48 ` [PATCH v17 04/14] util/cutils: Add qemu_strtotime_ns() Tao Xu
2019-11-22  7:48 ` [PATCH v17 05/14] qapi: Add builtin type time Tao Xu
2019-11-25  8:04   ` Markus Armbruster
2019-11-22  7:48 ` [PATCH v17 06/14] tests: Add test for QAPI " Tao Xu
2019-11-25  9:08   ` Markus Armbruster
2019-11-22  7:48 ` [PATCH v17 07/14] numa: Extend CLI to provide initiator information for numa nodes Tao Xu
2019-11-22  7:48 ` [PATCH v17 08/14] numa: Extend CLI to provide memory latency and bandwidth information Tao Xu
2019-11-22  7:48 ` [PATCH v17 09/14] numa: Extend CLI to provide memory side cache information Tao Xu
2019-11-22 12:21   ` Igor Mammedov
2019-11-22  7:48 ` [PATCH v17 10/14] hmat acpi: Build Memory Proximity Domain Attributes Structure(s) Tao Xu
2019-11-22  7:48 ` [PATCH v17 11/14] hmat acpi: Build System Locality Latency and Bandwidth Information Structure(s) Tao Xu
2019-11-22  7:48 ` [PATCH v17 12/14] hmat acpi: Build Memory Side Cache " Tao Xu
2019-11-22 12:32   ` Igor Mammedov
2019-11-25  1:10     ` Tao Xu
2019-11-22  7:48 ` [PATCH v17 13/14] tests/numa: Add case for QMP build HMAT Tao Xu
2019-11-22 12:45   ` Igor Mammedov
2019-11-22  7:48 ` [PATCH v17 14/14] tests/bios-tables-test: add test cases for ACPI HMAT Tao Xu
2019-11-22  8:41 ` [PATCH v17 00/14] Build ACPI Heterogeneous Memory Attribute Table (HMAT) no-reply
2019-11-22  9:17 ` no-reply
2019-11-22 12:38   ` Igor Mammedov
2019-11-25  1:08     ` Tao Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a96d3d0b-bcb1-937b-419c-89201213a94d@intel.com \
    --to=tao3.xu@intel.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=fan.du@intel.com \
    --cc=imammedo@redhat.com \
    --cc=jingqi.liu@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).