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

Fix cache alignment issues for software interrupt tracking #323

Open
bushidocodes opened this issue Apr 4, 2022 · 0 comments
Open

Fix cache alignment issues for software interrupt tracking #323

bushidocodes opened this issue Apr 4, 2022 · 0 comments

Comments

@bushidocodes
Copy link
Contributor

Oh no! These are not cache aligned. This is a large amount of false sharing that will cause a big perf decrease on multicore.

We want to essentially have each atomic be 128 bytes apart (on 128-aligned boundaries). The typical way to accomplish this without blowing up the cache and memory consumption is to put the counters in a struct, and align the structs.

struct event_counts {
    _Atomic volatile sig_atomic_t software_interrupt_counts_sigalarm_reply;
    _Atomic volatile sig_atomic_t software_interrupt_counts_kernel;
    /* ... */     
} __attribute((aligned(128)));

struct event_counts software_interrupt_counts[runtime_worker_threads_count];

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