Skip to content

Commit 42940f5

Browse files
authored
remove deprecated 'NATIVE' AIO mode (#10269)
Co-authored-by: Chris McFarlen <cmcfarlen@apple.com>
1 parent 3de9b5c commit 42940f5

File tree

14 files changed

+5
-425
lines changed

14 files changed

+5
-425
lines changed

CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ check_symbol_exists(kqueue "sys/event.h" TS_USE_KQUEUE)
248248
set(CMAKE_REQUIRED_LIBRARIES uring)
249249
check_symbol_exists(io_uring_queue_init "liburing.h" HAVE_IOURING)
250250
unset(CMAKE_REQUIRED_LIBRARIES)
251-
set(CMAKE_REQUIRED_LIBRARIES aio)
252-
check_symbol_exists(io_submit "libaio.h" HAVE_LIBAIO)
253-
unset(CMAKE_REQUIRED_LIBRARIES)
254251
check_symbol_exists(getresuid unistd.h HAVE_GETRESUID)
255252
check_symbol_exists(getresgid unistd.h HAVE_GETRESGID)
256253
check_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4)
@@ -262,12 +259,6 @@ if (HAVE_IOURING AND USE_IOURING)
262259
set(TS_USE_LINUX_IO_URING 1)
263260
endif(HAVE_IOURING AND USE_IOURING)
264261

265-
option(USE_LIBAIO "Use experimental libaio (linux only)" 0)
266-
if (HAVE_LIBAIO AND USE_LIBAIO)
267-
message(Using libaio)
268-
set(TS_USE_LINUX_NATIVE_AIO 1)
269-
endif(HAVE_LIBAIO AND USE_LIBAIO)
270-
271262
# Check ssl functionality
272263
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
273264
list(APPEND CMAKE_REQUIRED_LIBRARIES

configure.ac

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,35 +1645,6 @@ AS_IF([test "x$enable_posix_cap" != "xno"],
16451645
)
16461646
AC_SUBST(use_posix_cap)
16471647

1648-
#
1649-
# If the OS is linux, we can use the '--enable-experimental-linux-native-aio' option to
1650-
# replace the aio thread mode. Effective only on the linux system.
1651-
#
1652-
1653-
AC_MSG_CHECKING([whether to enable Linux native AIO])
1654-
AC_ARG_ENABLE([experimental-linux-native-aio],
1655-
[AS_HELP_STRING([--enable-experimental-linux-native-aio], [WARNING this is experimental and has known issues enable native Linux AIO support @<:@default=no@:>@])],
1656-
[enable_linux_native_aio="${enableval}"],
1657-
[enable_linux_native_aio=no]
1658-
)
1659-
1660-
AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
1661-
if test $host_os_def != "linux"; then
1662-
AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
1663-
fi
1664-
1665-
AC_CHECK_HEADERS([libaio.h], [],
1666-
[AC_MSG_ERROR([Linux native AIO requires libaio.h])]
1667-
)
1668-
1669-
AC_SEARCH_LIBS([io_submit], [aio], [],
1670-
[AC_MSG_ERROR([Linux native AIO requires libaio])]
1671-
)
1672-
])
1673-
1674-
AC_MSG_RESULT([$enable_linux_native_aio])
1675-
TS_ARG_ENABLE_VAR([use], [linux_native_aio])
1676-
16771648
# Check for enabling io_uring on linux
16781649

16791650
AC_MSG_CHECKING([whether to enable Linux io_uring])

doc/developer-guide/testing/blackbox-testing.en.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ Condition Testing
254254
- TS_USE_TLS13
255255
- TS_USE_QUIC
256256
- TS_HAS_QUICHE
257-
- TS_USE_LINUX_NATIVE_AIO
258257
- TS_HAS_SO_PEERCRED
259258
- TS_USE_REMOTE_UNWINDING
260259
- TS_HAS_128BIT_CAS
@@ -266,10 +265,6 @@ Examples:
266265
+++++++++
267266
.. code-block:: python
268267
269-
Test.SkipUnless(
270-
Condition.HasATSFeature('TS_USE_LINUX_NATIVE_AIO'),
271-
)
272-
273268
Test.SkipUnless(
274269
Condition.HasCurlFeature('http2'),
275270
)

include/tscore/ink_config.h.cmake.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
136136
#cmakedefine01 TS_USE_HWLOC
137137
#cmakedefine01 TS_USE_KQUEUE
138138
#cmakedefine01 TS_USE_LINUX_IO_URING
139-
#cmakedefine01 TS_USE_LINUX_NATIVE_AIO
140139
#cmakedefine01 TS_USE_POSIX_CAP
141140
#cmakedefine01 TS_USE_QUIC
142141
#cmakedefine01 TS_USE_REMOTE_UNWINDING

include/tscore/ink_config.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
#define TS_HAS_QUICHE @has_quiche@
7979
#define TS_USE_TLS_SET_CIPHERSUITES @use_tls_set_ciphersuites@
8080
#define TS_HAS_TLS_KEYLOGGING @has_tls_keylogging@
81-
#define TS_USE_LINUX_NATIVE_AIO @use_linux_native_aio@
8281
#define TS_USE_LINUX_IO_URING @use_linux_io_uring@
8382
#define TS_USE_REMOTE_UNWINDING @use_remote_unwinding@
8483
#define TS_HAS_TLS_EARLY_DATA @has_tls_early_data@

iocore/aio/AIO.cc

Lines changed: 2 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@
3232

3333
#include "P_AIO.h"
3434

35-
#if AIO_MODE == AIO_MODE_NATIVE
36-
37-
#ifdef HAVE_EVENTFD
38-
#include <sys/eventfd.h>
39-
#endif
40-
41-
#define AIO_PERIOD -HRTIME_MSECONDS(10)
42-
#else
43-
4435
#define MAX_DISKS_POSSIBLE 100
4536

4637
// globals
@@ -51,7 +42,6 @@ namespace
5142
{
5243
void setup_prep_ops(IOUringContext *);
5344
}
54-
5545
#endif
5646

5747
/* structure to hold information about each file descriptor */
@@ -64,7 +54,6 @@ int num_filedes = 1;
6454
static ink_mutex insert_mutex;
6555

6656
int thread_is_created = 0;
67-
#endif // AIO_MODE == AIO_MODE_NATIVE
6857

6958
RecInt cache_config_threads_per_disk = 12;
7059
RecInt api_config_threads_per_disk = 12;
@@ -189,17 +178,12 @@ ink_aio_init(ts::ModuleVersion v, AIOBackend backend)
189178
RecRegisterRawStat(aio_rsb, RECT_PROCESS, "proxy.process.io_uring.completed", RECD_FLOAT, RECP_PERSISTENT,
190179
(int)AIO_STAT_IO_URING_COMPLETED, aio_stats_cb);
191180
#endif
192-
#if AIO_MODE == AIO_MODE_DEFAULT
181+
193182
memset(&aio_reqs, 0, MAX_DISKS_POSSIBLE * sizeof(AIO_Reqs *));
194183
ink_mutex_init(&insert_mutex);
195-
#endif
184+
196185
REC_ReadConfigInteger(cache_config_threads_per_disk, "proxy.config.cache.threads_per_disk");
197-
#if TS_USE_LINUX_NATIVE_AIO
198-
Warning(
199-
"Running with Linux libaio is deprecated. There are known issues with this feature and it is being replaced with io_uring");
200-
#endif
201186

202-
#if AIO_MODE == AIO_MODE_DEFAULT
203187
#if TS_USE_LINUX_IO_URING
204188
// If the caller specified auto backend, check for config to force a backend
205189
if (backend == AIOBackend::AIO_BACKEND_AUTO) {
@@ -250,11 +234,8 @@ ink_aio_init(ts::ModuleVersion v, AIOBackend backend)
250234
Note("Using thread for AIO");
251235
}
252236
#endif
253-
#endif
254237
}
255238

256-
#if AIO_MODE == AIO_MODE_DEFAULT
257-
258239
struct AIOThreadInfo : public Continuation {
259240
AIO_Reqs *req;
260241
int sleep_wait;
@@ -706,162 +687,3 @@ ink_aio_write(AIOCallback *op_in, int fromAPI)
706687

707688
return 1;
708689
}
709-
#endif
710-
711-
#if AIO_MODE == AIO_MODE_NATIVE
712-
int
713-
DiskHandler::startAIOEvent(int /* event ATS_UNUSED */, Event *e)
714-
{
715-
SET_HANDLER(&DiskHandler::mainAIOEvent);
716-
e->schedule_every(AIO_PERIOD);
717-
trigger_event = e;
718-
return EVENT_CONT;
719-
}
720-
721-
int
722-
DiskHandler::mainAIOEvent(int event, Event *e)
723-
{
724-
AIOCallback *op = nullptr;
725-
Lagain:
726-
int ret = io_getevents(ctx, 0, MAX_AIO_EVENTS, events, nullptr);
727-
for (int i = 0; i < ret; i++) {
728-
op = (AIOCallback *)events[i].data;
729-
op->aio_result = events[i].res;
730-
ink_assert(op->action.continuation);
731-
complete_list.enqueue(op);
732-
}
733-
734-
if (ret == MAX_AIO_EVENTS) {
735-
goto Lagain;
736-
}
737-
738-
if (ret < 0) {
739-
if (errno == EINTR)
740-
goto Lagain;
741-
if (errno == EFAULT || errno == ENOSYS)
742-
Dbg(_dbg_ctl_aio, "io_getevents failed: %s (%d)", strerror(-ret), -ret);
743-
}
744-
745-
ink_aiocb *cbs[MAX_AIO_EVENTS];
746-
int num = 0;
747-
748-
for (; num < MAX_AIO_EVENTS && ((op = ready_list.dequeue()) != nullptr); ++num) {
749-
cbs[num] = &op->aiocb;
750-
ink_assert(op->action.continuation);
751-
}
752-
753-
if (num > 0) {
754-
int ret;
755-
do {
756-
ret = io_submit(ctx, num, cbs);
757-
} while (ret < 0 && ret == -EAGAIN);
758-
759-
if (ret != num) {
760-
if (ret < 0) {
761-
Dbg(_dbg_ctl_aio, "io_submit failed: %s (%d)", strerror(-ret), -ret);
762-
} else {
763-
Fatal("could not submit IOs, io_submit(%p, %d, %p) returned %d", ctx, num, cbs, ret);
764-
}
765-
}
766-
}
767-
768-
while ((op = complete_list.dequeue()) != nullptr) {
769-
op->mutex = op->action.mutex;
770-
MUTEX_TRY_LOCK(lock, op->mutex, trigger_event->ethread);
771-
if (!lock.is_locked()) {
772-
trigger_event->ethread->schedule_imm(op);
773-
} else {
774-
op->handleEvent(EVENT_NONE, nullptr);
775-
}
776-
}
777-
return EVENT_CONT;
778-
}
779-
780-
int
781-
ink_aio_read(AIOCallback *op, int /* fromAPI ATS_UNUSED */)
782-
{
783-
op->aiocb.aio_lio_opcode = IO_CMD_PREAD;
784-
op->aiocb.data = op;
785-
EThread *t = this_ethread();
786-
#ifdef HAVE_EVENTFD
787-
io_set_eventfd(&op->aiocb, t->evfd);
788-
#endif
789-
t->diskHandler->ready_list.enqueue(op);
790-
791-
return 1;
792-
}
793-
794-
int
795-
ink_aio_write(AIOCallback *op, int /* fromAPI ATS_UNUSED */)
796-
{
797-
op->aiocb.aio_lio_opcode = IO_CMD_PWRITE;
798-
op->aiocb.data = op;
799-
EThread *t = this_ethread();
800-
#ifdef HAVE_EVENTFD
801-
io_set_eventfd(&op->aiocb, t->evfd);
802-
#endif
803-
t->diskHandler->ready_list.enqueue(op);
804-
805-
return 1;
806-
}
807-
808-
int
809-
ink_aio_readv(AIOCallback *op, int /* fromAPI ATS_UNUSED */)
810-
{
811-
EThread *t = this_ethread();
812-
DiskHandler *dh = t->diskHandler;
813-
AIOCallback *io = op;
814-
int sz = 0;
815-
816-
while (io) {
817-
io->aiocb.aio_lio_opcode = IO_CMD_PREAD;
818-
io->aiocb.data = io;
819-
#ifdef HAVE_EVENTFD
820-
io_set_eventfd(&op->aiocb, t->evfd);
821-
#endif
822-
dh->ready_list.enqueue(io);
823-
++sz;
824-
io = io->then;
825-
}
826-
827-
if (sz > 1) {
828-
ink_assert(op->action.continuation);
829-
AIOVec *vec = new AIOVec(sz, op);
830-
while (--sz >= 0) {
831-
op->action = vec;
832-
op = op->then;
833-
}
834-
}
835-
return 1;
836-
}
837-
838-
int
839-
ink_aio_writev(AIOCallback *op, int /* fromAPI ATS_UNUSED */)
840-
{
841-
EThread *t = this_ethread();
842-
DiskHandler *dh = t->diskHandler;
843-
AIOCallback *io = op;
844-
int sz = 0;
845-
846-
while (io) {
847-
io->aiocb.aio_lio_opcode = IO_CMD_PWRITE;
848-
io->aiocb.data = io;
849-
#ifdef HAVE_EVENTFD
850-
io_set_eventfd(&op->aiocb, t->evfd);
851-
#endif
852-
dh->ready_list.enqueue(io);
853-
++sz;
854-
io = io->then;
855-
}
856-
857-
if (sz > 1) {
858-
ink_assert(op->action.continuation);
859-
AIOVec *vec = new AIOVec(sz, op);
860-
while (--sz >= 0) {
861-
op->action = vec;
862-
op = op->then;
863-
}
864-
}
865-
return 1;
866-
}
867-
#endif // AIO_MODE != AIO_MODE_NATIVE

0 commit comments

Comments
 (0)