[libvirt] [PATCH] news: Add support for MBA (Memory Bandwidth Allocation)

2018-08-13 Thread bing . niu
From: Bing Niu Signed-off-by: Bing Niu --- docs/news.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 2f0c010..c6d03f5 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -44,6 +44,15 @@ iscsiadm. It support basic pool operations

[libvirt] [PATCH v2 RESEND 16/17] conf: Add return value check to virResctrlAllocForeachCache

2018-07-29 Thread bing . niu
From: Bing Niu Add return value check to virResctrlAllocForeachCache in virDomainCachetuneDefFormat. The virResctrlAllocForeachCache dose have return value, so need check return value to make sure function executed without error. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 8

[libvirt] [PATCH v2 RESEND 13/17] conf: Factor out vcpus overlapping from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Factor out vcpus overlapping detecting part from virDomainCachetuneDefParse and introduce virDomainResctrlVcpuMatch. Instead of allocating virResctrlAllocPtr by default, allocating virResctrlAllocPtr after confirm vcpus not overlap with existing ones. And virDomainResctrlVcpuMatch

[libvirt] [PATCH v2 RESEND 15/17] conf: Add support for memorytune XML processing for resctrl MBA

2018-07-29 Thread bing . niu
From: Bing Niu Introduce a new section memorytune to support memory bandwidth allocation. This is consistent with existing cachetune. As the example: below: .. vpus --- vpus subjected to this memory bandwidth. id--- on which node memory bandwidth

[libvirt] [PATCH v2 RESEND 08/17] util: Add support to calculate MBA utilization

2018-07-29 Thread bing . niu
From: Bing Niu Introduce virResctrlMemoryBandwidthSubtract and virResctrlAllocMemoryBandwidth to be used as part of the virResctrlAllocAssign processing to configure the available memory bandwidth. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 105

[libvirt] [PATCH v2 RESEND 05/17] util: Add MBA check to virResctrlInfoGetCache

2018-07-29 Thread bing . niu
From: Bing Niu If we have some membw_info data, then we need to calculate the number of MBA controllers on the system. The value cannot be obtained from a direct query to the RDT kernel module, but it is the same as the last level cache value which is calculated by traversing the cache hierarchy

[libvirt] [PATCH v2 RESEND 07/17] util: Add MBA schemata parse and format methods

2018-07-29 Thread bing . niu
From: Bing Niu Introduce virResctrlAllocMemoryBandwidthFormat and virResctrlAllocParseMemoryBandwidthLine which will format and parse an entry in the schemata file for MBA. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 141 ++ 1 file

[libvirt] [PATCH v2 RESEND 10/17] util: Introduce virResctrlAllocSetMemoryBandwidth

2018-07-29 Thread bing . niu
From: Bing Niu Introduce an API to allow setting of the MBA from domain XML. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 48 src/util/virresctrl.h| 5 + 3 files changed, 54 insertions

[libvirt] [PATCH v2 RESEND 14/17] conf: Factor out virDomainResctrlDef update from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Factor out vcpus virDomainResctrlDef update from virDomainCachetuneDefParse and introduce virDomainResctrlAppend. virDomainResctrlAppend will format vcpus string and append a new virDomainResctrlDef to virDomainDefPtr. So that this logic can be reusable. Signed-off-by: Bing Niu

[libvirt] [PATCH v2 RESEND 17/17] conf: Add memory bandwidth allocation capability of host

2018-07-29 Thread bing . niu
From: Bing Niu Add new XML section to report host's memory bandwidth allocation capability. The format as below example: . granularity granularity of memory bandwidth, unit percentage. min minimum memory bandwidth allowed, unit

[libvirt] [PATCH v2 RESEND 03/17] util: Refactor virResctrlAllocFormat of virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Refactor virResctrlAllocFormat so that it is easy to support other resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions

[libvirt] [PATCH v2 RESEND 11/17] conf: Rename cachetune to resctrl

2018-07-29 Thread bing . niu
From: Bing Niu Resctrl not only supports cache tuning, but also memory bandwidth tuning. Renaming cachetune to resctrl to reflect that. With resctrl, all allocation for different resources (cache, memory bandwidth) are aggregated and represented by a virResctrlAllocPtr inside virDomainResctrlDef

[libvirt] [PATCH v2 RESEND 09/17] util: Introduce virResctrlAllocForeachMemory

2018-07-29 Thread bing . niu
From: Bing Niu Introduce an API that will traverse the memory bandwidth data calling a callback function for each defined bandwidth entry. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 33 + src/util/virresctrl.h

[libvirt] [PATCH v2 RESEND 12/17] conf: Factor out vcpus parsing part from virDomainCachetuneDefParse

2018-07-29 Thread bing . niu
From: Bing Niu Extract vcpus parsing part from virDomainCachetuneDefParse into one function called virDomainResctrlParseVcpus. So that vcpus parsing logic can be reused by other resource control technologies. Adjust error message and use node->name so that the error message can fit to

[libvirt] [PATCH v2 RESEND 00/17] Introduce RDT memory bandwidth allocation support

2018-07-29 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method

[libvirt] [PATCH v2 RESEND 01/17] util: Rename some functions of virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Some functions in virresctrl are for CAT only, while some of other functions are for resource allocation, not just CAT. So change their names to reflect the reality. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 8 src

[libvirt] [PATCH v2 RESEND 04/17] util: Add MBA capability information query to resctrl

2018-07-29 Thread bing . niu
From: Bing Niu Introducing virResctrlInfoMemBW for the information memory bandwidth allocation information. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 84 +++ 1 file changed, 84 insertions(+) diff --git a/src

[libvirt] [PATCH v2 RESEND 02/17] util: Refactor virResctrlGetInfo in virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Separate resctrl common information parts from CAT specific parts, so that common information parts can be reused among different resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 32

[libvirt] [PATCH v2 RESEND 06/17] util: Add MBA allocation to virresctrl

2018-07-29 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support to virresctrl class. Introducing virResctrlAllocMemBW which is used for allocating memory bandwidth. Following virResctrlAllocPerType, it also employs a nested sparse array to indicate whether allocation is available for particular last

[libvirt] [PATCH v2 17/17] conf: Add memory bandwidth allocation capability of host

2018-07-28 Thread bing . niu
From: Bing Niu Add new XML section to report host's memory bandwidth allocation capability. The format as below example: . granularity granularity of memory bandwidth, unit percentage. min minimum memory bandwidth allowed, unit

[libvirt] [PATCH v2 14/17] conf: Factor out virDomainResctrlDef update from virDomainCachetuneDefParse

2018-07-28 Thread bing . niu
From: Bing Niu Factor out vcpus virDomainResctrlDef update from virDomainCachetuneDefParse and introduce virDomainUpdateResctrl. virDomainUpdateResctrl will format vcpus string and update virDomainResctrlDef in virDomainDefPtr. So that this logic can be reusable. Signed-off-by: Bing Niu

[libvirt] [PATCH v2 16/17] conf: Add return value check to virResctrlAllocForeachCache

2018-07-28 Thread bing . niu
From: Bing Niu Add return value check to virResctrlAllocForeachCache in virDomainCachetuneDefFormat. The virResctrlAllocForeachCache dose have return value, so need check return value to make sure function execute without error. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 8

[libvirt] [PATCH v2 15/17] conf: Add support for memorytune XML processing for resctrl MBA

2018-07-28 Thread bing . niu
From: Bing Niu Introduce a new section memorytune to support memory bandwidth allocation. This is consistent with existing cachetune. As the example: below: .. vpus --- vpus subjected to this memory bandwidth. id--- on which node memory bandwidth

[libvirt] [PATCH v2 10/17] util: Introduce virResctrlAllocSetMemoryBandwidth

2018-07-28 Thread bing . niu
From: Bing Niu Introduce an API to allow setting of the MBA from domain XML. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 48 src/util/virresctrl.h| 5 + 3 files changed, 54 insertions

[libvirt] [PATCH v2 12/17] conf: Factor out vcpus parsing part from virDomainCachetuneDefParse

2018-07-28 Thread bing . niu
From: Bing Niu Extract vcpus parsing part from virDomainCachetuneDefParse into one function called virDomainResctrlParseVcpus. So that vcpus parsing logic can be reused by other resource control technologies. Adjust error message and use node->name so that the error message can fit to

[libvirt] [PATCH v2 13/17] conf: Factor out vcpus overlapping from virDomainCachetuneDefParse

2018-07-28 Thread bing . niu
From: Bing Niu Factor out vcpus overlapping detecting part from virDomainCachetuneDefParse and introduce virDomainResctrlVcpuMatch. Instead of allocating virResctrlAllocPtr by default, allocating virResctrlAllocPtr after confirm vcpus not overlap with existing ones. And virDomainResctrlVcpuMatch

[libvirt] [PATCH v2 07/17] util: Add MBA schemata parse and format methods

2018-07-28 Thread bing . niu
From: Bing Niu Introduce virResctrlAllocMemoryBandwidthFormat and virResctrlAllocParseMemoryBandwidthLine which will format and parse an entry in the schemata file for MBA. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 141 ++ 1 file

[libvirt] [PATCH v2 09/17] util: Introduce virResctrlAllocForeachMemory

2018-07-28 Thread bing . niu
From: Bing Niu Introduce an API that will traverse the memory bandwidth data calling a callback function for each defined bandwidth entry. Signed-off-by: Bing Niu --- src/libvirt_private.syms | 1 + src/util/virresctrl.c| 33 + src/util/virresctrl.h

[libvirt] [PATCH v2 06/17] util: Add MBA allocation to virresctrl

2018-07-28 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support to virresctrl class. Introducing virResctrlAllocMemBW which is used for allocating memory bandwidth. Following virResctrlAllocPerType, it also employs a nested sparse array to indicate whether allocation is available for particular last

[libvirt] [PATCH v2 11/17] conf: Rename cachetune to resctrl

2018-07-28 Thread bing . niu
From: Bing Niu Resctrl not only supports cache tuning, but also memory bandwidth tuning. Renaming cachetune to resctrl to reflect that. With resctrl, all allocation for different resources (cache, memory bandwidth) are aggregated and represented by a virResctrlAllocPtr inside virDomainResctrlDef

[libvirt] [PATCH v2 08/17] util: Add support to calculate MBA utilization

2018-07-28 Thread bing . niu
From: Bing Niu Introduce virResctrlMemoryBandwidthSubtract and virResctrlAllocMemoryBandwidth to be used as part of the virResctrlAllocAssign processing to configure the available memory bandwidth. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 105

[libvirt] [PATCH v2 03/17] util: Refactor virResctrlAllocFormat of virresctrl

2018-07-28 Thread bing . niu
From: Bing Niu Refactor virResctrlAllocFormat so that it is easy to support other resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 41 ++--- 1 file changed, 26 insertions(+), 15 deletions

[libvirt] [PATCH v2 02/17] util: Refactor virResctrlGetInfo in virresctrl

2018-07-28 Thread bing . niu
From: Bing Niu Separate resctrl common information parts from CAT specific parts, so that common information parts can be reused among different resource allocation technologies. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 32

[libvirt] [PATCH v2 05/17] util: Add MBA check to virResctrlInfoGetCache

2018-07-28 Thread bing . niu
From: Bing Niu If we have some membw_info data, then we need to calculate the number of MBA controllers on the system. The value cannot be obtained from a direct query to the RDT kernel module, but it is the same as the last level cache value which is calculated by traversing the cache hierarchy

[libvirt] [PATCH v2 01/17] util: Rename some functions of virresctrl

2018-07-28 Thread bing . niu
From: Bing Niu Some functions in virresctrl are for CAT only, while some of other functions are for resource allocation, not just CAT. So change their names to reflect the reality. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 8 src

[libvirt] [PATCH v2 00/17] Introduce RDT memory bandwidth allocation support

2018-07-28 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method

[libvirt] [PATCH v2 04/17] util: Add MBA capability information query to resctrl

2018-07-28 Thread bing . niu
From: Bing Niu Introducing virResctrlInfoMemBW for the information memory bandwidth allocation information. Signed-off-by: Bing Niu Reviewed-by: John Ferlan --- src/util/virresctrl.c | 84 +++ 1 file changed, 84 insertions(+) diff --git a/src

[libvirt] [PATCH 5/9] util: Add MBA allocation to virresctrl

2018-07-18 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support to virresctrl class. Introducing virResctrlAllocMemBW which is used for allocating memory bandwidth. Following virResctrlAllocPerType, it also employs a nested sparse array to indicate whether allocation is available for particular last

[libvirt] [PATCH 6/9] conf: Rename cachetune to restune

2018-07-18 Thread bing . niu
From: Bing Niu Resctrl not only supports cache tuning, but also memory bandwidth tuning. Renaming cachetune to restune(resource tuning) to reflect that. With restune, all allocation for different resources (cache, memory bandwidth) are aggregated and represented by a virResctrlAllocPtr inside

[libvirt] [PATCH 3/9] util: Refactor virResctrlAllocFormat of virresctrl

2018-07-18 Thread bing . niu
From: Bing Niu Refactor virResctrlAllocFormat so that it is easy to support other resource allocation technologies. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 43 --- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/util

[libvirt] [PATCH 2/9] util: Refactor virResctrlGetInfo in virresctrl

2018-07-18 Thread bing . niu
From: Bing Niu Separate resctrl common information parts from CAT specific parts, so that common information parts can be reused among different resource allocation technologies. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 31 ++- 1 file changed, 22

[libvirt] [PATCH 8/9] conf: Introduce cputune/memorytune to support memory bandwidth allocation

2018-07-18 Thread bing . niu
From: Bing Niu Introduce a new section memorytune to support memory bandwidth allocation. This is consistent with existing cachetune. As the example: below: .. vpus --- vpus subjected to this memory bandwidth. id--- on which node memory bandwidth

[libvirt] [PATCH 7/9] conf: Refactor virDomainCachetuneDefParse

2018-07-18 Thread bing . niu
From: Bing Niu Refactoring virDomainCachetuneDefParse, extracting vcpus extracting, overlapping detecting and new resctrl allocation creating logic. Those two logic is common among different resource allocation technologies. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 195

[libvirt] [PATCH 1/9] util: Rename some functions of virresctrl

2018-07-18 Thread bing . niu
From: Bing Niu Some functions in virresctrl are for CAT only, while some of other functions are for resource allocation, not just CAT. So change their names to reflect the reality. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 8 src/libvirt_private.syms | 4 ++-- src/util

[libvirt] [PATCH 9/9] conf: Add memory bandwidth allocation capability of host

2018-07-18 Thread bing . niu
From: Bing Niu Add new XML section to report host's memory bandwidth allocation capability. The format as below example: . granularity granularity of memory bandwidth, unit percentage. min minimum memory bandwidth allowed, unit

[libvirt] [PATCH 0/9] Introduce RDT memory bandwidth allocation support

2018-07-18 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method

[libvirt] [PATCH 4/9] util: Add MBA capability information query to resctrl

2018-07-18 Thread bing . niu
From: Bing Niu Introducing virResctrlInfoMemBW for the information memory bandwidth allocation information. Those information is used for memory bandwidth allocating. Signed-off-by: Bing Niu --- src/util/virresctrl.c | 104 ++ 1 file changed

[libvirt] [RFCv2 PATCH 2/5] util: Add memory bandwidth support to resctrl

2018-06-15 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support basing on existing virresctrl implementation. Two new structures virResctrlInfoMB and virResctrlAllocMB are introduced. virResctrlInfoMB is used to record host system MBA supporting information, e.g., minimum bandwidth allowed, bandwidth

[libvirt] [RFCv2 PATCH 4/5] conf: Introduce cputune/memorytune to support memory bandwidth allocation

2018-06-15 Thread bing . niu
From: Bing Niu Introduce a new section memorytune to support memory bandwidth allocation. This is consistent with existing cachetune . As the example below: id--- on which node memory bandwidth to be set bandwidth --- the memory bandwidth percent

[libvirt] [RFCv2 PATCH 1/5] util: Rename and packing parts of virresctrl

2018-06-15 Thread bing . niu
From: Bing Niu Renaming some functions and packing some CAT logic into functions Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 2 +- src/libvirt_private.syms | 2 +- src/util/virresctrl.c| 93 +++- src/util/virresctrl.h| 16

[libvirt] [RFCv2 PATCH 3/5] conf: rename cachetune to restune

2018-06-15 Thread bing . niu
From: Bing Niu resctrl not only supports cache tuning, but also memory bandwidth tuning. Rename cachetune to restune(resource tuning) to reflect that. Signed-off-by: Bing Niu --- src/conf/domain_conf.c | 44 ++-- src/conf/domain_conf.h | 10

[libvirt] [RFCv2 PATCH 5/5] conf: add memory bandwidth allocation capability of host

2018-06-15 Thread bing . niu
From: Bing Niu Add new XML section to report host's memory bandwidth allocation capability. The format as below example: . granularity granularity of memory bandwidth, unit percentage. min minimum memory bandwidth allowed

[libvirt] [RFCv2 PATCH 0/5] Introduce RDT memory bandwidth allocation support

2018-06-15 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method

[libvirt] [RFC PATCH 0/2] Introduce RDT memory bandwidth allocation support

2018-05-29 Thread bing . niu
From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and approximate control over memory bandwidth available per-core. This feature provides a method

[libvirt] [RFC PATCH 1/2] util: Add memory bandwidth support to resctrl

2018-05-29 Thread bing . niu
From: Bing Niu Add memory bandwidth allocation support basing on existing virresctrl implementation. Two new structures virResctrlInfoMB and virResctrlAllocMB are introduced. virResctrlInfoMB is used to record host system MBA supporting information, e.g., minimum bandwidth allowed, bandwidth

[libvirt] [RFC PATCH 2/2] conf: Extend cputune/cachetune to support memory bandwidth allocation

2018-05-29 Thread bing . niu
From: Bing Niu Extend current cachetune section to support memory bandwidth allocation. Add a new cachetune element llc for memory allocation. As the example below: id--- on which last level cache memory bandwidth to be set bandwidth --- the memory