]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: fd: cache-align fdtab and fdcache locks
authorWilly Tarreau <w@1wt.eu>
Sun, 26 Nov 2017 10:07:34 +0000 (11:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 Nov 2017 10:10:51 +0000 (11:10 +0100)
These locks are highly contended, let's not make them share cache lines.

include/proto/fd.h

index ce23c1cf2256d6570f5c10846b70819897bdea19..8cc191f75da2b4096e53d834492a5d05b6346a5d 100644 (file)
@@ -39,9 +39,9 @@ extern int fd_cache_num;            // number of events in the cache
 extern THREAD_LOCAL int *fd_updt;  // FD updates list
 extern THREAD_LOCAL int fd_nbupdt; // number of updates in the list
 
-__decl_hathreads(extern HA_SPINLOCK_T fdtab_lock);      /* global lock to protect fdtab array */
-__decl_hathreads(extern HA_RWLOCK_T   fdcache_lock);    /* global lock to protect fd_cache array */
-__decl_hathreads(extern HA_SPINLOCK_T poll_lock);       /* global lock to protect poll info */
+__decl_hathreads(extern HA_SPINLOCK_T __attribute__((aligned(64))) fdtab_lock);      /* global lock to protect fdtab array */
+__decl_hathreads(extern HA_RWLOCK_T   __attribute__((aligned(64))) fdcache_lock);    /* global lock to protect fd_cache array */
+__decl_hathreads(extern HA_SPINLOCK_T __attribute__((aligned(64))) poll_lock);       /* global lock to protect poll info */
 
 /* Deletes an FD from the fdsets, and recomputes the maxfd limit.
  * The file descriptor is also closed.