diff --git a/include/types/fd.h b/include/types/fd.h index 53364612b..35d3bc237 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -120,7 +120,6 @@ struct fdtab { __decl_hathreads(HA_SPINLOCK_T lock); unsigned long thread_mask; /* mask of thread IDs authorized to process the task */ unsigned long update_mask; /* mask of thread IDs having an update for fd */ - struct fdlist_entry cache; /* Entry in the fdcache */ struct fdlist_entry update; /* Entry in the global update list */ void (*iocb)(int fd); /* I/O handler */ void *owner; /* the connection or listener associated with this fd, NULL if closed */ @@ -128,7 +127,14 @@ struct fdtab { unsigned char ev; /* event seen in return of poll() : FD_POLL_* */ unsigned char linger_risk:1; /* 1 if we must kill lingering before closing */ unsigned char cloned:1; /* 1 if a cloned socket, requires EPOLL_CTL_DEL on close */ -}; +} +#ifdef USE_THREAD +/* only align on cache lines when using threads; 32-bit small archs + * can put everything in 32-bytes when threads are disabled. + */ +__attribute__((aligned(64))) +#endif +; /* less often used information */ struct fdinfo { diff --git a/src/fd.c b/src/fd.c index 620de5979..17cf52b2d 100644 --- a/src/fd.c +++ b/src/fd.c @@ -596,7 +596,6 @@ int init_pollers() for (p = 0; p < global.maxsock; p++) { HA_SPIN_INIT(&fdtab[p].lock); /* Mark the fd as out of the fd cache */ - fdtab[p].cache.next = -3; fdtab[p].update.next = -3; } diff --git a/src/stream.c b/src/stream.c index 095565a81..75cacc1dc 100644 --- a/src/stream.c +++ b/src/stream.c @@ -3214,11 +3214,10 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st obj_base_ptr(conn->target)); chunk_appendf(&trash, - " flags=0x%08x fd=%d fd.state=%02x fd.cache=%d updt=%d fd.tmask=0x%lx\n", + " flags=0x%08x fd=%d fd.state=%02x updt=%d fd.tmask=0x%lx\n", conn->flags, conn->handle.fd, conn->handle.fd >= 0 ? fdtab[conn->handle.fd].state : 0, - conn->handle.fd >= 0 ? fdtab[conn->handle.fd].cache.next >= -2 : 0, conn->handle.fd >= 0 ? !!(fdtab[conn->handle.fd].update_mask & tid_bit) : 0, conn->handle.fd >= 0 ? fdtab[conn->handle.fd].thread_mask: 0); @@ -3251,11 +3250,10 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st obj_base_ptr(conn->target)); chunk_appendf(&trash, - " flags=0x%08x fd=%d fd.state=%02x fd.cache=%d updt=%d fd.tmask=0x%lx\n", + " flags=0x%08x fd=%d fd.state=%02x updt=%d fd.tmask=0x%lx\n", conn->flags, conn->handle.fd, conn->handle.fd >= 0 ? fdtab[conn->handle.fd].state : 0, - conn->handle.fd >= 0 ? fdtab[conn->handle.fd].cache.next >= -2 : 0, conn->handle.fd >= 0 ? !!(fdtab[conn->handle.fd].update_mask & tid_bit) : 0, conn->handle.fd >= 0 ? fdtab[conn->handle.fd].thread_mask: 0);