All of lore.kernel.org
 help / color / mirror / Atom feed
From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
	IanJackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Tiejun Chen <tiejun.chen@intel.com>
Subject: Re: [PATCH] xen/domctl: lower loglevel of XEN_DOMCTL_memory_mapping
Date: Fri, 11 Sep 2015 13:05:30 +0100	[thread overview]
Message-ID: <55F2C38A.2070606@citrix.com> (raw)
In-Reply-To: <55F2D31202000078000A20AB@prv-mh.provo.novell.com>

On 11/09/15 12:11, Jan Beulich wrote:
>>>> On 11.09.15 at 12:28, <malcolm.crossley@citrix.com> wrote:
>> On 11/09/15 10:17, Jan Beulich wrote:
>>>>>> On 11.09.15 at 02:59, <konrad.wilk@oracle.com> wrote:
>>>> If you want a formula I would do:
>>>>
>>>> #define MAX_SOCKETS 8
>>>>
>>>>  max_pfns = pow(2,(MAX_SOCKETS - (max(nr_iommus(), MAX_SOCKETS)))) * 64;
>>>>
>>>> Where nr_iommus would have to be somehow implemented, ditto for pow.
>>>>
>>>> This should give you:
>>>>  8	-> 64
>>>>  7	-> 128
>>>>  6	-> 256
>>>>  5	-> 512
>>>>  4	-> 1024
>>>>  3	-> 2048
>>>>  2	-> 4096
>>>>  1	-> 16384
>>>
>>> 16k seems excessive as a default. Also - why would this be related
>>> to the number of sockets? I don't think there's a one-IOMMU-per-
>>> socket rule; fixed-number-of-IOMMUs-per-node might come closer,
>>> but there we'd have the problem of what "fixed number" is. Wouldn't
>>> something as simple as 1024 / nr_iommus() do?
>>>
>>> I also don't follow what cache flushes you talked about earlier: I
>>> don't think the IOMMUs drive any global cache flushes, and I
>>> would have thought the size limited IOTLB and (CPU side) cache
>>> ones should be pretty limited in terms of bus load (unless the TLB
>>> ones would get converted to global ones due to lacking IOMMU
>>> capabilities). Is that not the case?
>>
>> The data cache flushes are caused by the memory_type_changed()
>> call at the bottom of the XEN_DOMCTL_memory_mapping hypercall,
>> not by the IOMMU code itself.
> 
> In which case - contrary to what Konrad said he measured - their
> impact on overall throughput shouldn't scale with socket (or node)
> count (unless the hardware implementation of the flushes is bad).
> 

The flush_all(FLUSH_CACHE) in mtrr.c will result in a flush_area_mask for all CPU's in the host.
It will more time to issue a IPI to all logical cores the more core's there are. I admit that
x2apic_cluster mode may speed this up but not all hosts will have that enabled.

The data flush will force all data out to memory controllers and it's possible that CPU's in
difference package have cached data all corresponding to a particular memory controller which will
become a bottleneck.

In worst case, with large delay between XEN_DOMCTL_memory_mapping hypercalls and on a 8 socket
system you may end up writing out 45MB (L3 cache) * 8 = 360MB to a single memory controller every 64
pages (256KiB) of domU p2m updated.

Malcolm


> Jan
> 

  reply	other threads:[~2015-09-11 12:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  6:50 [PATCH] xen/domctl: lower loglevel of XEN_DOMCTL_memory_mapping Tiejun Chen
2015-09-09 14:20 ` Konrad Rzeszutek Wilk
2015-09-09 14:33   ` Jan Beulich
2015-09-09 14:50     ` Konrad Rzeszutek Wilk
2015-09-09 14:55       ` Jan Beulich
2015-09-09 15:05         ` Konrad Rzeszutek Wilk
2015-09-09 15:19       ` Malcolm Crossley
2015-09-09 15:44         ` Jan Beulich
2015-09-10  5:28           ` Chen, Tiejun
2015-09-10  8:13             ` Jan Beulich
2015-09-10  8:55               ` Chen, Tiejun
2015-09-10  8:59                 ` Jan Beulich
2015-09-10 17:55                   ` Konrad Rzeszutek Wilk
2015-09-11  0:44                     ` Chen, Tiejun
2015-09-11  0:59                       ` Konrad Rzeszutek Wilk
2015-09-11  9:17                         ` Jan Beulich
2015-09-11 10:28                           ` Malcolm Crossley
2015-09-11 11:11                             ` Jan Beulich
2015-09-11 12:05                               ` Malcolm Crossley [this message]
2015-09-11 14:11                                 ` Jan Beulich

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=55F2C38A.2070606@citrix.com \
    --to=malcolm.crossley@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=tiejun.chen@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.