From cd3bccc5d041676d5eef43e99233a7207c5107f2 Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Sat, 8 Feb 2025 00:17:13 +0800 Subject: [PATCH] add kernel option aio-max-nr for aio=native storage For VMs that have disks with aio=native, the qemu will request an io_setup with nr_events=1024, and hence on each VM startup, the fs.aio-nr will be incremented by 1024. Once it reaches the fs.aio-max-nrlimit (65536 by default), the new io_setup request from the newly spawned VMs will fail with EAGAIN Change-Id: I564d6b99e43e05b051de62d9aea2a1fe41dacd8a --- releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml | 6 ++++++ roles/sysctl/defaults/main.yml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml diff --git a/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml b/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml new file mode 100644 index 00000000..1f3ecadb --- /dev/null +++ b/releasenotes/notes/fix-aio-max-limit-228f73927b88d3ee.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + This fix introduces a kernel option to adjust ``aio-max-nr``, ensuring that the + system can handle more asynchronous I/O events, preventing VM startup + failures related to AIO limits. diff --git a/roles/sysctl/defaults/main.yml b/roles/sysctl/defaults/main.yml index 509597e5..dbb09e98 100644 --- a/roles/sysctl/defaults/main.yml +++ b/roles/sysctl/defaults/main.yml @@ -15,6 +15,8 @@ # # List of ``sysctl`` parameters to set sysctls: + - name: fs.aio-max-nr + value: 1048576 - name: net.ipv4.tcp_timestamps value: 0 - name: net.ipv4.tcp_sack