Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adjust oom_Score_adj for NRI plugins #92

Closed
zxj874478410 opened this issue Jul 10, 2024 · 2 comments · Fixed by #94
Closed

Support adjust oom_Score_adj for NRI plugins #92

zxj874478410 opened this issue Jul 10, 2024 · 2 comments · Fixed by #94
Milestone

Comments

@zxj874478410
Copy link
Contributor

The LinuxContainer structure transferred by the containerd contains the OomScoreAdj field. However, the NRI plugins do not support the adjustment of this field. Theoretically, the OomScoreAdj field should be customized by users to provide more refined QoS control.

The definition of LinuxContainer:

type LinuxContainer struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Namespaces  []*LinuxNamespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
	Devices     []*LinuxDevice    `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"`
	Resources   *LinuxResources   `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"`
	OomScoreAdj *OptionalInt      `protobuf:"bytes,4,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"`
	CgroupsPath string            `protobuf:"bytes,5,opt,name=cgroups_path,json=cgroupsPath,proto3" json:"cgroups_path,omitempty"`
}

The definition of LinuxContainerAdjustment:

type LinuxContainerAdjustment struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Devices     []*LinuxDevice  `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
	Resources   *LinuxResources `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"`
	CgroupsPath string          `protobuf:"bytes,3,opt,name=cgroups_path,json=cgroupsPath,proto3" json:"cgroups_path,omitempty"`
}

Obviously, losing the ability to oom adjust is not reasonable.

@samuelkarp
Copy link
Member

Obviously, losing the ability to oom adjust is not reasonable.

NRI currently supports a subset of fields as adjustable, and accepts pull requests to increase the set of supported fields. Supporting a subset was a reasonable mechanism to start experimenting with NRI and discovering use-cases that it can satisfy.

I would be open to supporting OomScoreAdj.

@zxj874478410
Copy link
Contributor Author

NRI currently supports a subset of fields as adjustable, and accepts pull requests to increase the set of supported fields. Supporting a subset was a reasonable mechanism to start experimenting with NRI and discovering use-cases that it can satisfy.

I tried to modify some of the NRI code to add the ability to adjust the OomScoreAdj, and it passed the functional verification. The relevant code is attached in PR #94.

@mikebrow mikebrow added this to the 1.0 milestone Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants