CLEANUP: fd: place the lock at the beginning of struct fdtab

The struct is not cache line aligned but at least, every time the lock
will appear in the same cache line as the fd it will benefit from being
accessed first. This improves the performance by about 2% on fd-intensive
workloads with 4 threads.
This commit is contained in:
Willy Tarreau 2017-11-26 10:41:47 +01:00
parent fd5efb5936
commit 5809052ae1

View File

@ -92,10 +92,10 @@ enum fd_states {
/* info about one given fd */
struct fdtab {
__decl_hathreads(HA_SPINLOCK_T lock);
unsigned long thread_mask; /* mask of thread IDs authorized to process the task */
void (*iocb)(int fd); /* I/O handler */
void *owner; /* the connection or listener associated with this fd, NULL if closed */
unsigned long thread_mask; /* mask of thread IDs authorized to process the task */
__decl_hathreads(HA_SPINLOCK_T lock);
unsigned int cache; /* position+1 in the FD cache. 0=not in cache. */
unsigned char state; /* FD state for read and write directions (2*3 bits) */
unsigned char ev; /* event seen in return of poll() : FD_POLL_* */