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

helpers and recommended way to express the zone identifier #34

Open
ffromani opened this issue May 5, 2023 · 0 comments
Open

helpers and recommended way to express the zone identifier #34

ffromani opened this issue May 5, 2023 · 0 comments

Comments

@ffromani
Copy link
Contributor

ffromani commented May 5, 2023

Currently, the zone ID (NUMA ID) is extracted from the zone (NUMA) name using fragile conventions. Application code uses something along the lines of

func getID(name string) (int, error) {
	var numaID int
	_, err := fmt.Sscanf(name, "node-%d", &numaID)
	if err != nil {
		return -1, fmt.Errorf("invalid zone format zone: %s", name)
	}
	if numaID > maxNUMAId-1 || numaID < 0 {
		return -1, fmt.Errorf("invalid NUMA id range numaID: %d", numaID)
	}
	return numaID, nil
}

Now that we have the helpers package, we should add 1. documentation and recommendations about how to expose zone (or at least NUMA) IDs and a helper function to abstract this part.

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

No branches or pull requests

1 participant