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
erasure-code: buffer alignment #2558
Conversation
SIMD optimized erasure code computation needs aligned memory. Buffers aligned to a page boundary are wasted on it though. The buffers used for the erasure code computation are typical smaller than a page. An alignment of 32 bytes is chosen to satisfy the needs of AVX/AVX2. Could be made arch specific to reduce the alignment to 16 bytes for arm/aarch64 NEON. Signed-off-by: Janne Grunau <j@jannau.net>
Requiring page aligned buffers and realigning the input if necessary creates measurable oberhead. ceph_erasure_code_benchmark is ~30% faster with this change for technique=reed_sol_van,k=2,m=1. Also prevents a misaligned buffer when bufferlist::c_str(bufferlist) has to allocate a new buffer to provide continuous one. See bug #9408 Signed-off-by: Janne Grunau <j@jannau.net>
The benchmark is supposed to measure the encoding speed and not the overhead of buffer realignments. Signed-off-by: Janne Grunau <j@jannau.net>
{ | ||
std::list<ptr>::iterator p = _buffers.begin(); | ||
while (p != _buffers.end()) { | ||
// keep anything that's already page sized+aligned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
page sized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover from the rebuild_page_aligned function from which it was copied
I think it would be tidier to make the alignment an argument to rebuild_aligned(n) is_aligned(n) and create_aligned(n). Unless that causes problems, in which case let's not hold this up... |
For the record performance compared : http://tracker.ceph.com/issues/9601 |
I've fixed the copy-n-paste error in the comment and reworked the set to allow variable alignment. I don't see an immediate need for a variable alignment though. Unifying it with page_aligned code is probably worth it though, |
jannau will open a new pull request with updated code |
re-using the same pull request instead |
No description provided.