All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen Platform QoS design discussion
@ 2014-04-30 16:47 Xu, Dongxiao
  2014-04-30 17:02 ` Ian Campbell
  0 siblings, 1 reply; 46+ messages in thread
From: Xu, Dongxiao @ 2014-04-30 16:47 UTC (permalink / raw)
  To: Jan Beulich (JBeulich@suse.com),
	Ian.Campbell, Andrew Cooper (andrew.cooper3@citrix.com)
  Cc: xen-devel

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

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2014-06-05 10:43 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 16:47 Xen Platform QoS design discussion Xu, Dongxiao
2014-04-30 17:02 ` 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

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.