Skip to content

Commit 18c952f

Browse files
committed
xapi: use hard-pinning with best-effort as an experimental feature (CP-54234)
This allows users to enable the feature on a host by running: echo 1 > /etc/xenserver/features.d/hard_numa xe host-apply-edition edition=${CURRENT_EDITION} host-uuid=${HOST_UUID} where CURRENT_EDITION is xe host-param-get param-name=edition uuid=${HOST_UUID} set best-effort mode if it wasn't already set: xe host-param-set uuid=${HOST-UUID} numa-affinity-policy=best-effort and finally restart the toolstack: xe-toolstack-restart Signed-off-by: Pau Ruiz Safont <pau.ruizsafont@cloud.com>
1 parent 02fca09 commit 18c952f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ocaml/xapi/xapi_xenops.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,6 +3110,12 @@ let resync_all_vms ~__context =
31103110
in
31113111
List.iter (fun vm -> refresh_vm ~__context ~self:vm) resident_vms_in_db
31123112

3113+
(* experimental feature for hard-pinning vcpus *)
3114+
let hard_numa_enabled ~__context =
3115+
let pool = Helpers.get_pool ~__context in
3116+
let restrictions = Db.Pool.get_restrictions ~__context ~self:pool in
3117+
List.assoc_opt "restrict_hard_numa" restrictions = Some "false"
3118+
31133119
let set_numa_affinity_policy ~__context ~value =
31143120
let dbg = Context.string_of_task __context in
31153121
let open Xapi_xenops_queue in
@@ -3119,6 +3125,8 @@ let set_numa_affinity_policy ~__context ~value =
31193125
match value with
31203126
| `any ->
31213127
Some Any
3128+
| `best_effort when hard_numa_enabled ~__context ->
3129+
Some Best_effort_hard
31223130
| `best_effort ->
31233131
Some Best_effort
31243132
| `default_policy ->

0 commit comments

Comments
 (0)