@@ -718,44 +718,44 @@ func (p *DynamicPolicy) sharedCoresWithNUMABindingHintHandler(_ context.Context,
718
718
req .PodNamespace , req .PodName , req .ContainerName , err )
719
719
return nil , fmt .Errorf ("GenerateMachineStateFromPodEntries failed with error: %v" , err )
720
720
}
721
- }
722
721
723
- general .Infof ("pod: %s/%s, container: %s, inplace update resize: %v" , req .PodNamespace , req .PodName , req .ContainerName , util .PodInplaceUpdateResizing (req ))
724
- numaSet := allocationInfo .GetAllocationResultNUMASet ()
725
- if numaSet .Size () != 1 {
726
- general .Errorf ("pod: %s/%s, container: %s is snb, but its numa set size is %d" ,
727
- req .PodNamespace , req .PodName , req .ContainerName , numaSet .Size ())
728
- return nil , fmt .Errorf ("snb port not support cross numa" )
729
- }
730
- nodeID := numaSet .ToSliceInt ()[0 ]
731
- availableCPUQuantity := machineState [nodeID ].GetAvailableCPUQuantity (p .reservedCPUs )
722
+ general .Infof ("pod: %s/%s, container: %s, inplace update resize: %v" , req .PodNamespace , req .PodName , req .ContainerName , util .PodInplaceUpdateResizing (req ))
723
+ numaSet := allocationInfo .GetAllocationResultNUMASet ()
724
+ if numaSet .Size () != 1 {
725
+ general .Errorf ("pod: %s/%s, container: %s is snb, but its numa set size is %d" ,
726
+ req .PodNamespace , req .PodName , req .ContainerName , numaSet .Size ())
727
+ return nil , fmt .Errorf ("snb port not support cross numa" )
728
+ }
729
+ nodeID := numaSet .ToSliceInt ()[0 ]
730
+ availableCPUQuantity := machineState [nodeID ].GetAvailableCPUQuantity (p .reservedCPUs )
732
731
733
- general .Infof ("pod: %s/%s, container: %s request cpu inplace update resize on numa %d (available: %.3f, request: %.3f)" ,
734
- req .PodNamespace , req .PodName , req .ContainerName , nodeID , availableCPUQuantity , request )
735
- if ! cpuutil .CPUIsSufficient (request , availableCPUQuantity ) { // no left resource to scale out
736
- general .Infof ("pod: %s/%s, container: %s request cpu inplace update resize, but no enough resource for it in current NUMA, checking migratable" ,
737
- req .PodNamespace , req .PodName , req .ContainerName )
738
- // TODO move this var to config
739
- isInplaceUpdateResizeNumaMigration := false
740
- if isInplaceUpdateResizeNumaMigration {
741
- general .Infof ("pod: %s/%s, container: %s request inplace update resize and no enough resource in current NUMA, try to migrate it to new NUMA" ,
732
+ general .Infof ("pod: %s/%s, container: %s request cpu inplace update resize on numa %d (available: %.3f, request: %.3f)" ,
733
+ req .PodNamespace , req .PodName , req .ContainerName , nodeID , availableCPUQuantity , request )
734
+ if ! cpuutil .CPUIsSufficient (request , availableCPUQuantity ) { // no left resource to scale out
735
+ general .Infof ("pod: %s/%s, container: %s request cpu inplace update resize, but no enough resource for it in current NUMA, checking migratable" ,
742
736
req .PodNamespace , req .PodName , req .ContainerName )
743
- var calculateErr error
744
- hints , calculateErr = p . calculateHintsForNUMABindingSharedCores ( request , podEntries , machineState , req )
745
- if calculateErr != nil {
746
- general .Errorf ("pod: %s/%s, container: %s request inplace update resize and no enough resource in current NUMA, failed to migrate it to new NUMA" ,
737
+ // TODO move this var to config
738
+ isInplaceUpdateResizeNumaMigration := false
739
+ if isInplaceUpdateResizeNumaMigration {
740
+ general .Infof ("pod: %s/%s, container: %s request inplace update resize and no enough resource in current NUMA, try to migrate it to new NUMA" ,
747
741
req .PodNamespace , req .PodName , req .ContainerName )
748
- return nil , fmt .Errorf ("calculateHintsForNUMABindingSharedCores failed in inplace update resize mode with error: %v" , calculateErr )
742
+ var calculateErr error
743
+ hints , calculateErr = p .calculateHintsForNUMABindingSharedCores (request , podEntries , machineState , req )
744
+ if calculateErr != nil {
745
+ general .Errorf ("pod: %s/%s, container: %s request inplace update resize and no enough resource in current NUMA, failed to migrate it to new NUMA" ,
746
+ req .PodNamespace , req .PodName , req .ContainerName )
747
+ return nil , fmt .Errorf ("calculateHintsForNUMABindingSharedCores failed in inplace update resize mode with error: %v" , calculateErr )
748
+ }
749
+ } else {
750
+ general .Errorf ("pod: %s/%s, container: %s request inplace update resize, but no enough resource for it in current NUMA" ,
751
+ req .PodNamespace , req .PodName , req .ContainerName )
752
+ return nil , errNoAvailableCPUHints
749
753
}
750
754
} else {
751
- general .Errorf ("pod: %s/%s, container: %s request inplace update resize, but no enough resource for it in current NUMA" ,
755
+ general .Infof ("pod: %s/%s, container: %s request inplace update resize, there is enough resource for it in current NUMA" ,
752
756
req .PodNamespace , req .PodName , req .ContainerName )
753
- return nil , errNoAvailableCPUHints
757
+ hints = cpuutil . RegenerateHints ( allocationInfo , false )
754
758
}
755
- } else {
756
- general .Infof ("pod: %s/%s, container: %s request inplace update resize, there is enough resource for it in current NUMA" ,
757
- req .PodNamespace , req .PodName , req .ContainerName )
758
- hints = cpuutil .RegenerateHints (allocationInfo , false )
759
759
}
760
760
} else {
761
761
var calculateErr error
0 commit comments