diff options
| author | Daniel Black <daniel@mariadb.org> | 2021-04-13 20:54:37 +1000 |
|---|---|---|
| committer | Daniel Black <daniel@mariadb.org> | 2021-04-15 04:58:58 +1000 |
| commit | 91b83e6236659c0a24a7aa0715a7beefea110e26 (patch) | |
| tree | c65634c4311e6cca1257c63785946c7d5f65a072 /tpool/aio_liburing.cc | |
| parent | c071cc3455b61b8f757b13ed1e4a5aa8b43423c9 (diff) | |
| download | mariadb-git-bb-10.6-iouring_required-memlock.tar.gz | |
io_liburing: ENOMEM handling - use io_uring_mlock_sizebb-10.6-iouring_required-memlock
This gives the user the size required and how to set
memlock limits for the process.
Also don't put \n on my_printf_error, its implicit.
Diffstat (limited to 'tpool/aio_liburing.cc')
| -rw-r--r-- | tpool/aio_liburing.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tpool/aio_liburing.cc b/tpool/aio_liburing.cc index 14219f1d499..bdc3601ae35 100644 --- a/tpool/aio_liburing.cc +++ b/tpool/aio_liburing.cc @@ -37,17 +37,27 @@ public: { switch (const auto e= errno) { case ENOMEM: + my_printf_error(ER_UNKNOWN_ERROR, + "io_uring_queue_init() failed with ENOMEM:" + " try larger memory locked limit, ulimit -l" + ", or https://mariadb.com/kb/en/systemd/#configuring-limitmemlock" + " under systemd" +#ifdef HAVE_IO_URING_MLOCK_SIZE + " (%zd bytes required)", ME_ERROR_LOG | ME_WARNING, + io_uring_mlock_size(max_aio, 0)); +#else + , ME_ERROR_LOG | ME_WARNING); +#endif + break; case ENOSYS: - my_printf_error(ER_UNKNOWN_ERROR, e == ENOMEM - ? "io_uring_queue_init() failed with ENOMEM:" - " try larger ulimit -l\n" - : "io_uring_queue_init() failed with ENOSYS:" - " try uprading the kernel\n", + my_printf_error(ER_UNKNOWN_ERROR, + "io_uring_queue_init() failed with ENOSYS:" + " try uprading the kernel", ME_ERROR_LOG | ME_WARNING); break; default: my_printf_error(ER_UNKNOWN_ERROR, - "io_uring_queue_init() failed with errno %d\n", + "io_uring_queue_init() failed with errno %d", ME_ERROR_LOG | ME_WARNING, e); } throw std::runtime_error("aio_uring()"); |
