All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xu, Dongxiao" <dongxiao.xu@intel.com>
To: "Jan Beulich (JBeulich@suse.com)" <JBeulich@suse.com>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"Andrew Cooper (andrew.cooper3@citrix.com)"
	<andrew.cooper3@citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Xen Platform QoS design discussion
Date: Wed, 30 Apr 2014 16:47:04 +0000	[thread overview]
Message-ID: <40776A41FC278F40B59438AD47D147A9119F3FEA@SHSMSX104.ccr.corp.intel.com> (raw)

Hello maintainers,

As PQoS feature has already been reviewed for 10 rounds, and also considering that more QoS related features are published in new SDM, like MBM and CQE (refer to chapter 17.14 and 17.15 of Intel SDM Volume 3). Before sending out another version of patch, I'd like to make sure we are aligned on some basic design issues, making the final implementation simple and performance efficient.

1) The hypercall to query QoS monitoring data, should be sysctl or domctl?
Previous QoS monitoring data query hypercall is designed with sysctl, which returns the whole QoS data in a 2-dimenstion array format for all domains. However users don't like to handle such 2-dimension array themselves, but preferring the hypercall API to be issued per-domain, by using domain id as the input parameter and returns the domain related QoS data. Here I propose to use the domctl style hypercall to get QoS data for specific domain. This has the advantage of simplifying the libxl QoS APIs for user-space developers, and also make the QoS memory allocation in Xen much easier.

2) How much memory needs to be allocated in Xen for QoS monitoring data?
There are a lot of comments complaining the previous memory allocation for QoS monitoring data. But if we adopt the domctl style of hypercall proposed in 1), then the needed memory is much smaller since the data structure becomes 1-dimension. We only need to allocate "nr_sockets" related size in initialization time to present the domain's QoS monitoring data. Furthermore, no additional QoS resource allocation logic is needed when CPU online/offline.

3) Copy or share for QoS monitoring data?
In previous patches, sharing mechanism is used for passing data between Xen and dom0 toolstack. However when MBM feature comes out, we may need to re-consider this solution.
CQM and MBM features belong to L3 monitoring category, and they share the same CPUID enumeration method for its QoS data structure, which is 64bit width. From data structure design point of view, all L3 monitoring category features (CQM, MBM and others in L3 category) should better to share the following structure:

struct socket_l3 {
    unsigned int socket_id;
    unsigned int l3_type; // CQM or MBM or others
    unsigned long qm_data_l3;
}

In hypercall, user sets the "l3_type" as an input parameter (CQM or MBM or others in L3 category), and Xen returns the qm_data_l3 as the monitoring data for that certain feature.
In this case, sharing doesn't work since data may be collapsed if there are two xl instances running simultaneously to separately get CQM and MBM data. Besides, if we use the per-domain hypercall (domctl instead of sysctl), the data amount is very small for every hypercall. (saying 4 sockets, the data amount is 4*sizeof(struct socket_l3) = 64 bytes per hypercall). Even for data sharing mechanism, we need to pass the page address as the parameter, which also requires 8 or more bytes. Therefore in my opinion, data copy is acceptable in PQoS case.

Any feedback is welcome!

Thanks,
Dongxiao

             reply	other threads:[~2014-04-30 16:47 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 16:47 Xu, Dongxiao [this message]
2014-04-30 17:02 ` Xen Platform QoS design discussion Ian Campbell
2014-05-01  0:56   ` Xu, Dongxiao
2014-05-02  9:23     ` Jan Beulich
2014-05-02 12:30       ` Xu, Dongxiao
2014-05-02 12:40         ` Jan Beulich
2014-05-04  0:46           ` Xu, Dongxiao
2014-05-06  9:10             ` Ian Campbell
2014-05-06  1:40           ` Xu, Dongxiao
2014-05-06  7:55             ` Jan Beulich
2014-05-06 10:06             ` Andrew Cooper
2014-05-07  2:08               ` Xu, Dongxiao
2014-05-07  9:10                 ` Ian Campbell
2014-05-07 13:26               ` George Dunlap
2014-05-07 21:18                 ` Andrew Cooper
2014-05-08  5:21                   ` Xu, Dongxiao
2014-05-08 11:25                     ` Andrew Cooper
2014-05-09  2:41                       ` Xu, Dongxiao
2014-05-13  1:53                       ` Xu, Dongxiao
2014-05-16  5:11                       ` Xu, Dongxiao
2014-05-19 11:28                         ` George Dunlap
2014-05-19 11:45                           ` Jan Beulich
2014-05-19 12:13                             ` George Dunlap
2014-05-19 12:41                               ` Jan Beulich
2014-05-22  8:19                                 ` Xu, Dongxiao
2014-05-22  8:39                                   ` Jan Beulich
2014-05-22  9:27                                     ` George Dunlap
2014-05-26  0:51                                       ` Xu, Dongxiao
2014-05-29  0:45                                       ` Xu, Dongxiao
2014-05-29  7:01                                         ` Jan Beulich
2014-05-29  7:31                                           ` Xu, Dongxiao
2014-05-29  9:11                                             ` Jan Beulich
2014-05-30  9:10                                               ` Ian Campbell
2014-05-30 11:17                                                 ` Jan Beulich
2014-05-30 12:33                                                   ` Ian Campbell
2014-06-05  0:48                                                   ` Xu, Dongxiao
2014-06-05 10:43                                                     ` George Dunlap
2014-05-29  9:13                                             ` Andrew Cooper
2014-05-30  1:07                                               ` Xu, Dongxiao
2014-05-30  6:23                                                 ` Jan Beulich
2014-05-30  7:51                                                   ` Xu, Dongxiao
2014-05-30 11:15                                                     ` Jan Beulich
2014-05-02 12:50         ` Andrew Cooper
2014-05-04  2:34           ` Xu, Dongxiao
2014-05-06  9:12             ` Ian Campbell
2014-05-06 10:00             ` Andrew Cooper

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=40776A41FC278F40B59438AD47D147A9119F3FEA@SHSMSX104.ccr.corp.intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --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.