mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-23 10:15:31 +02:00
MEDIUM: ring: align the head and tail fields in the ring_storage structure
We really want to let the readers and writers act on different areas, so we want to have the tail and the head on separate cache lines, themselves separate from the rest of the ring. Doing so improves the performance from 2.15 to 2.35M msg/s at 48 threads on a 24-core EPYC. This increases the header space from 32 to 192 bytes when threads are enabled. But since we already have the header size available in the file, haring remains able to detect the aligned vs unaligned formats and call dump_v2a() when aligned is detected.
This commit is contained in:
@@ -107,8 +107,11 @@
|
||||
struct ring_storage {
|
||||
size_t size; // storage size
|
||||
size_t rsvd; // header length (used for file-backed maps)
|
||||
THREAD_PAD(64 - 2 * sizeof(size_t));
|
||||
size_t tail; // storage tail
|
||||
THREAD_PAD(64 - sizeof(size_t));
|
||||
size_t head; // storage head
|
||||
THREAD_PAD(64 - sizeof(size_t));
|
||||
char area[0]; // storage area begins immediately here
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user