From 0cf31ad272ee3856668d25ba4e483f8171cc4baa Mon Sep 17 00:00:00 2001 From: Marc Alexander Lehmann Date: Sat, 22 Jun 2019 22:29:38 +0000 Subject: [PATCH] *** empty log message *** --- ev_linuxaio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ev_linuxaio.c b/ev_linuxaio.c index a798cb0..9d33e83 100644 --- a/ev_linuxaio.c +++ b/ev_linuxaio.c @@ -44,9 +44,9 @@ /* we try to fill 4kB pages exactly. * the ring buffer header is 32 bytes, every io event is 32 bytes. * the kernel takes the io event number, doubles it, adds 2, adds the ring buffer. - * therefore the calculation below will use "exactly" 8kB for the ring buffer + * therefore the calculation below will use "exactly" 4kB for the ring buffer */ -#define EV_LINUXAIO_DEPTH (256 / 2 - 2 - 1) /* max. number of io events per batch */ +#define EV_LINUXAIO_DEPTH (128 / 2 - 2 - 1) /* max. number of io events per batch */ /*****************************************************************************/ /* syscall wrapdadoop */ @@ -207,8 +207,6 @@ linuxaio_get_events_from_ring (EV_P) { struct aio_ring *ring = (struct aio_ring *)linuxaio_ctx; - ECB_MEMORY_FENCE_ACQUIRE; - unsigned head = ring->head; unsigned tail = *(volatile unsigned *)&ring->tail; @@ -221,6 +219,8 @@ linuxaio_get_events_from_ring (EV_P) || ring->header_length != sizeof (struct aio_ring)) /* TODO: or use it to find io_event[0]? */ return 0; + ECB_MEMORY_FENCE_ACQUIRE; + /* parse all available events, but only once, to avoid starvation */ if (tail > head) /* normal case around */ linuxaio_parse_events (EV_A_ ring->io_events + head, tail - head);