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

Add CachePadded variants with capped max alignment #1118

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jules-Bertholet
Copy link
Contributor

@Jules-Bertholet Jules-Bertholet commented Jun 10, 2024

These are useful for ensuring that values cross as few cache lines as possible, without restricting whether they can share one.

These are useful for ensuring that values don't *cross* a cache line,
without restricting whether they can *share* one.
@taiki-e
Copy link
Member

taiki-e commented Jun 10, 2024

ensuring that values don't cross a cache line

Given how we set our aarch64 and x86_64's alignments, I don't think this implementation is sufficient.

I'm also interested in what concrete cases this would be useful.

@Jules-Bertholet
Copy link
Contributor Author

Jules-Bertholet commented Jun 10, 2024

My phrasing of "don't cross a cache line" was suboptimal; I've changed it to "cross as few cache lines as possible", which is what I really want. My use case is that I have a large, but not too large, value (a lookup table), and I want it to take up as few cache lines as possible.

@Jules-Bertholet
Copy link
Contributor Author

Given how we set our aarch64 and x86_64's alignments, I don't think this implementation is sufficient.

Could you elaborate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants