[pve-devel] [PATCH v2 pve-manager 5/7] use ksm && swap for best node ordering

Alexandre Derumier aderumier at odiso.com
Wed Oct 9 16:01:35 CEST 2019


commented for now, ksm && swap are not streamed currently

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/API2/Nodes.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 3578b6de..93bf1bd2 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -2002,6 +2002,9 @@ __PACKAGE__->register_method ({
 			next if $@;
 			# fixme: check vmbr available
 
+			#for target node ordering, take swap && ksm in account;
+			#$node_freemem = $node_freemem - $node_stats->{swapused} - $node_stats->{ksm_shared};
+
 			my @vec_node = ($node_freecpu, $node_freemem); #? add network usage dimension ?
 			my $weight = dotprod(\@vec_vm,\@vec_node, 'normR');
 			$nodes_weight->{$weight} = $node;
-- 
2.20.1




More information about the pve-devel mailing list