]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
OPTIM: tasks: align task and tasklet pools to 64
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Aug 2025 15:29:04 +0000 (17:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Aug 2025 17:55:30 +0000 (19:55 +0200)
These structs are intensively used and really must not experience false
sharing, so let's declare them aligned to 64. We don't try to align the
struct themselves, as we don't want the compiler to expand them either.

src/task.c

index f60ee99bfefdba46f9ab72c4cd481c8703f5af63..11b5e635e3056ba5c11513a698e1a6604c2e2021 100644 (file)
@@ -27,8 +27,8 @@
 extern struct task *process_stream(struct task *t, void *context, unsigned int state);
 extern void stream_update_timings(struct task *t, uint64_t lat, uint64_t cpu);
 
-DECLARE_TYPED_POOL(pool_head_task,    "task",    struct task);
-DECLARE_TYPED_POOL(pool_head_tasklet, "tasklet", struct tasklet);
+DECLARE_TYPED_POOL(pool_head_task,    "task",    struct task, 0, 64);
+DECLARE_TYPED_POOL(pool_head_tasklet, "tasklet", struct tasklet, 0, 64);
 
 /* This is the memory pool containing all the signal structs. These
  * struct are used to store each required signal between two tasks.