Skip to content

Commit 4a3a8a3

Browse files
committed
CP-53642: change default NUMA placement policy to best-effort
We've seen that using the policy can be up to 10% faster than using any is some workflows, while not observing workflows that were negatively affected. The policy per VM can always be change if need be. Note that currently sometime the best-effort falls back to the same behaviour, especially when restarting on starting more than one VM at a time. This needs xen patches to be fixed: https://lore.kernel.org/xen-devel/[email protected]/T/#ma1246e352ea3cce71c7ddc26d1329a368548b3b2 Now the deprecated numa-placement configuration option for xenopsd does nothing. It was exclusively used to enable Best_effort, since now it's the default, there's no point in setting the option. It's value depends on whether the default option is best_effort or not, as per the spec. Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 983a48a commit 4a3a8a3

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

ocaml/xenopsd/lib/xenops_server.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,9 +3472,9 @@ module VIF = struct
34723472
()
34733473
end
34743474

3475-
let default_numa_affinity_policy = ref Xenops_interface.Host.Any
3475+
let default_numa_affinity_policy = ref Xenops_interface.Host.Best_effort
34763476

3477-
let numa_placement = ref Xenops_interface.Host.Any
3477+
let numa_placement = ref !default_numa_affinity_policy
34783478

34793479
let string_of_numa_affinity_policy =
34803480
Xenops_interface.Host.(function Any -> "any" | Best_effort -> "best-effort")

ocaml/xenopsd/lib/xenopsd.ml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ let feature_flags_path = ref "/etc/xenserver/features.d"
5959

6060
let pvinpvh_xen_cmdline = ref "pv-shim console=xen"
6161

62-
let numa_placement_compat = ref false
63-
6462
(* O(N^2) operations, until we get a xenstore cache, so use a small number here *)
6563
let vm_guest_agent_xenstore_quota = ref 128
6664

@@ -242,8 +240,11 @@ let options =
242240
, "Command line for the inner-xen for PV-in-PVH guests"
243241
)
244242
; ( "numa-placement"
245-
, Arg.Bool (fun x -> numa_placement_compat := x)
246-
, (fun () -> string_of_bool !numa_placement_compat)
243+
, Arg.Bool (fun _ -> ())
244+
, (fun () ->
245+
string_of_bool
246+
(!Xenops_server.default_numa_affinity_policy = Best_effort)
247+
)
247248
, "NUMA-aware placement of VMs (deprecated, use XAPI setting)"
248249
)
249250
; ( "pci-quarantine"

ocaml/xenopsd/xc/xenops_server_xen.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5294,8 +5294,6 @@ let init () =
52945294
{Xs_protocol.ACL.owner= 0; other= Xs_protocol.ACL.READ; acl= []}
52955295
) ;
52965296
Device.Backend.init () ;
5297-
Xenops_server.default_numa_affinity_policy :=
5298-
if !Xenopsd.numa_placement_compat then Best_effort else Any ;
52995297
info "Default NUMA affinity policy is '%s'"
53005298
Xenops_server.(string_of_numa_affinity_policy !default_numa_affinity_policy) ;
53015299
Xenops_server.numa_placement := !Xenops_server.default_numa_affinity_policy ;

0 commit comments

Comments
 (0)