Skip to content

Commit

Permalink
feat(agent): support disable core binding in native policy
Browse files Browse the repository at this point in the history
Signed-off-by: caohe <[email protected]>
  • Loading branch information
caohe committed Nov 5, 2024
1 parent ed0c4fb commit a622a03
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/agent/qrm-plugins/cpu/nativepolicy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ func (p *NativePolicy) GetResourcePluginOptions(context.Context,
*pluginapi.Empty,
) (*pluginapi.ResourcePluginOptions, error) {
general.Infof("called")
return &pluginapi.ResourcePluginOptions{
PreStartRequired: false,
WithTopologyAlignment: true,
NeedReconcile: true,
}, nil
if p.enableCoreBinding {
return &pluginapi.ResourcePluginOptions{
PreStartRequired: false,
WithTopologyAlignment: true,
NeedReconcile: true,
}, nil
}

return &pluginapi.ResourcePluginOptions{}, nil
}

// GetTopologyHints returns hints of corresponding resources
Expand Down Expand Up @@ -432,7 +436,7 @@ func (p *NativePolicy) Allocate(ctx context.Context,
}, nil
}

if req.NativeQosClass != string(v1.PodQOSGuaranteed) || !isInteger {
if !p.enableCoreBinding || req.NativeQosClass != string(v1.PodQOSGuaranteed) || !isInteger {
return p.sharedPoolAllocationHandler(ctx, req)
}
return p.dedicatedCoresAllocationHandler(ctx, req)
Expand Down

0 comments on commit a622a03

Please sign in to comment.