[Devel] [PATCH] aio: Multiply passed nr_events in io_setup()

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 20 05:04:22 PDT 2016


CRIU supports AIO in kernel versions >= 3.19.
It expects the logic, which was introduced in
kernel commit e1bdd5f27a5b, when it became
to multiply the passed nr_events twice.
Vz7 kernel doesn't do that, and this lead
to wrong calculation of lenght of AIO ring in CRIU.

This is a port of small part of commit e1bdd5f27a5b,
to make CRIU works on Virtuozzo 7 kernel.

https://jira.sw.ru/browse/PSBM-47075

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 fs/aio.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/aio.c b/fs/aio.c
index 29d02ab..ee72178 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -596,6 +596,9 @@ static struct kioctx *ioctx_alloc(unsigned nr_events)
 	struct ve_struct *ve = get_exec_env();
 	int err = -ENOMEM;
 
+	/* Kernel since e1bdd5f27a5b do this, and criu is tuned on that */
+	nr_events *= 2;
+
 	/* Prevent overflows */
 	if ((nr_events > (0x10000000U / sizeof(struct io_event))) ||
 	    (nr_events > (0x10000000U / sizeof(struct kiocb)))) {



More information about the Devel mailing list