From 0e331b82fdadfc78a4faf5bbcfd761a1ebd0ed49 Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 6 Sep 2018 13:37:32 +0200 Subject: [PATCH] CPU pinning: updated page structure --- plugins/dynamix/CPUisol.page | 2 +- plugins/dynamix/CPUpin.page | 2 +- plugins/dynamix/CPUset.page | 201 +---------------------------------- plugins/dynamix/CPUvms.page | 199 ++++++++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+), 201 deletions(-) create mode 100644 plugins/dynamix/CPUvms.page diff --git a/plugins/dynamix/CPUisol.page b/plugins/dynamix/CPUisol.page index 27420b077..9af88ce60 100644 --- a/plugins/dynamix/CPUisol.page +++ b/plugins/dynamix/CPUisol.page @@ -1,4 +1,4 @@ -Menu="CPUset:2" +Menu="CPUset:3" Title="CPU Isolation" Tag="leaf" --- diff --git a/plugins/dynamix/CPUpin.page b/plugins/dynamix/CPUpin.page index 06d87c4fd..f833b944e 100644 --- a/plugins/dynamix/CPUpin.page +++ b/plugins/dynamix/CPUpin.page @@ -1,4 +1,4 @@ -Menu="CPUset:1" +Menu="CPUset:2" Title="CPU Pinning Docker" Tag="map-marker" --- diff --git a/plugins/dynamix/CPUset.page b/plugins/dynamix/CPUset.page index 6a25401c8..64fa815ee 100644 --- a/plugins/dynamix/CPUset.page +++ b/plugins/dynamix/CPUset.page @@ -1,201 +1,4 @@ Menu="OtherSettings" -Title="CPU Pinning VM" +Title="CPU Pinning" Type="xmenu" -Icon="grid.png" -Tag="map-marker" ---- - -
"; -$cpuset = implode(';',$cpus); - -function create() { - // create the table header. Make multiple rows when CPU cores are many ;) - global $total,$cpus; - $loop = floor(($total-1)/32)+1; - $text = []; - for ($c = 0; $c < $loop; $c++) { - $max = ($c==$loop-1 ? ($total%32?:32) : 32); - for ($n = 0; $n < $max; $n++) { - unset($cpu1,$cpu2); - list($cpu1, $cpu2) = preg_split('/[,-]/',$cpus[$c*32+$n]); - $text[$n] .="$cpu1
"; - if ($cpu2) $text[$n] .= "$cpu2
"; - } - } - $label = implode('
',array_fill(0,$loop,'CPU:'.($cpu2 ? '
HT:':''))); - echo "$label".implode(array_map(function($t){return "$t";},$text)); -} -?> - - - -
- - - - -
VM
- -
- -
No CPU pinning available. VM service must be started
- - -> This page gives a total view of the current CPU pinning assignments for VMs.
-> It also allows to modify these assignments. -> -> Running VMs are **stopped first** and restarted after the modification.
-> Stopped VMs are instantly modified and new assignments become active when the user manually starts the VM. -> -> When ***Apply*** is pressed a scan is performed to find the changes, subsequently only VMs which have changes are modified in parallel. -> -> *Important: Please wait until all updates are finished before leaving this page*. +Icon="grid.png" \ No newline at end of file diff --git a/plugins/dynamix/CPUvms.page b/plugins/dynamix/CPUvms.page new file mode 100644 index 000000000..3c78f13e5 --- /dev/null +++ b/plugins/dynamix/CPUvms.page @@ -0,0 +1,199 @@ +Menu="CPUset:1" +Title="CPU Pinning VM" +Tag="map-marker" +--- + +
"; +$cpuset = implode(';',$cpus); + +function create() { + // create the table header. Make multiple rows when CPU cores are many ;) + global $total,$cpus; + $loop = floor(($total-1)/32)+1; + $text = []; + for ($c = 0; $c < $loop; $c++) { + $max = ($c==$loop-1 ? ($total%32?:32) : 32); + for ($n = 0; $n < $max; $n++) { + unset($cpu1,$cpu2); + list($cpu1, $cpu2) = preg_split('/[,-]/',$cpus[$c*32+$n]); + $text[$n] .="$cpu1
"; + if ($cpu2) $text[$n] .= "$cpu2
"; + } + } + $label = implode('
',array_fill(0,$loop,'CPU:'.($cpu2 ? '
HT:':''))); + echo "$label".implode(array_map(function($t){return "$t";},$text)); +} +?> + + + +
+ + + + +
VM
+ +
+ +
No CPU pinning available. VM service must be started
+ + +> This page gives a total view of the current CPU pinning assignments for VMs.
+> It also allows to modify these assignments. +> +> Running VMs are **stopped first** and restarted after the modification.
+> Stopped VMs are instantly modified and new assignments become active when the user manually starts the VM. +> +> When ***Apply*** is pressed a scan is performed to find the changes, subsequently only VMs which have changes are modified in parallel. +> +> *Important: Please wait until all updates are finished before leaving this page*.