xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Yu, Zhang" <yu.c.zhang@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: kevin.tian@intel.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
	andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, Paul.Durrant@citrix.com,
	zhiyuan.lv@intel.com, keir@xen.org
Subject: Re: [PATCH v2 3/3] tools: introduce parameter max_wp_ram_ranges.
Date: Wed, 27 Jan 2016 22:13:32 +0800	[thread overview]
Message-ID: <56A8D08C.7070804@linux.intel.com> (raw)
In-Reply-To: <56A8A9A102000078000CB799@prv-mh.provo.novell.com>



On 1/27/2016 6:27 PM, Jan Beulich wrote:
>>>> On 27.01.16 at 08:01, <yu.c.zhang@linux.intel.com> wrote:
>
>>
>> On 1/26/2016 7:00 PM, Jan Beulich wrote:
>>>>>> On 26.01.16 at 08:32, <yu.c.zhang@linux.intel.com> wrote:
>>>> On 1/22/2016 4:01 PM, Jan Beulich wrote:
>>>>>>>> On 22.01.16 at 04:20, <yu.c.zhang@linux.intel.com> wrote:
>>>>>> --- a/xen/arch/x86/hvm/hvm.c
>>>>>> +++ b/xen/arch/x86/hvm/hvm.c
>>>>>> @@ -940,6 +940,10 @@ static int hvm_ioreq_server_alloc_rangesets(struct
>>>>>> hvm_ioreq_server *s,
>>>>>>     {
>>>>>>         unsigned int i;
>>>>>>         int rc;
>>>>>> +    unsigned int max_wp_ram_ranges =
>>>>>> +        ( s->domain->arch.hvm_domain.params[HVM_PARAM_MAX_WP_RAM_RANGES] > 0 ) ?
>>>>>> +        s->domain->arch.hvm_domain.params[HVM_PARAM_MAX_WP_RAM_RANGES] :
>>>>>> +        MAX_NR_IO_RANGES;
>>>>>
>>>>> Besides this having stray blanks inside the parentheses it truncates
>>>>> the value from 64 to 32 bits and would benefit from using the gcc
>>>>> extension of omitting the middle operand of ?:. But even better
>>>>> would imo be if you avoided the local variable and ...
>>>>>
>>>> After second thought, how about we define a default value for this
>>>> parameter in libx.h, and initialize the parameter when creating the
>>>> domain with default value if it's not configured.
>>>
>>> No, I don't think the tool stack should be determining the default
>>> here (unless you want the default to be zero, and have zero
>>> indeed mean zero).
>>>
>> Thank you, Jan.
>> If we do not provide a default value in tool stack, the code above
>> should be kept, to initialize the local variable with either the one
>> set in the configuration file, or with MAX_NR_IO_RANGES. Is this OK?
>
> Well, not exactly: For one, the original comment (still present
> above) regarding truncation holds. And then another question is:
> Do you expect this resource type to be useful with its number of
> ranges limited to MAX_NR_IO_RANGES? I ask because if the
> answer is "no", having it default to zero might be as reasonable.
>

Thanks, Jan.

About the default value:
   You are right. :) For XenGT, MAX_NR_IO_RANGES may only work under
limited conditions. Having it default to zero means XenGT users must
manually configure this option. Since we have plans to push other XenGT
tool stack parameters(including a GVT-g flag), how about we set this
max_wp_ram_ranges to a default one when GVT-g flag is detected, and
till then, max_wp_ram_ranges is supposed to be configured explicitly for
XenGT?

About the truncation issue:
   I do not quite follow. Will this hurt if the value configured does
not exceed 4G? What about a type cast?

B.R.
Yu



> Jan
>
>

  reply	other threads:[~2016-01-27 14:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  3:20 [PATCH v11 0/3] Refactor ioreq server for better performance Yu Zhang
2016-01-22  3:20 ` [PATCH v11 1/3] Refactor rangeset structure " Yu Zhang
2016-01-22  3:20 ` [PATCH v11 2/3] Differentiate IO/mem resources tracked by ioreq server Yu Zhang
2016-01-22 11:43   ` Jan Beulich
2016-01-26  7:59     ` Yu, Zhang
2016-01-26 11:24       ` Jan Beulich
2016-01-27  7:02         ` Yu, Zhang
2016-01-27 10:28           ` Jan Beulich
2016-01-22  3:20 ` [PATCH v2 3/3] tools: introduce parameter max_wp_ram_ranges Yu Zhang
2016-01-22  8:01   ` Jan Beulich
2016-01-26  7:32     ` Yu, Zhang
2016-01-26 11:00       ` Jan Beulich
2016-01-27  7:01         ` Yu, Zhang
2016-01-27 10:27           ` Jan Beulich
2016-01-27 14:13             ` Yu, Zhang [this message]
2016-01-27 14:32               ` Jan Beulich
2016-01-27 14:56                 ` Yu, Zhang
2016-01-27 15:12                   ` Jan Beulich
2016-01-27 15:23                     ` Yu, Zhang
2016-01-27 15:58                       ` Jan Beulich
2016-01-27 16:12                         ` Yu, Zhang
2016-01-26 11:16   ` David Vrabel
2016-01-27  7:03     ` Yu, Zhang

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=56A8D08C.7070804@linux.intel.com \
    --to=yu.c.zhang@linux.intel.com \
    --cc=JBeulich@suse.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=zhiyuan.lv@intel.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).