[Devel] [PATCH RHEL7 COMMIT] ms/aio: Multiply passed nr_events in io_setup()
Konstantin Khorenko
khorenko at virtuozzo.com
Fri May 20 08:07:21 PDT 2016
The commit is pushed to "branch-rh7-3.10.0-327.18.2.vz7.14.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.18.2.vz7.14.5
------>
commit c1cb4f8b3b9ebfc9697c8b3eff7fb134556b8794
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Fri May 20 19:07:21 2016 +0400
ms/aio: Multiply passed nr_events in io_setup()
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
("aio: percpu reqs_available"), to make CRIU works on Virtuozzo 7 kernel.
https://jira.sw.ru/browse/PSBM-47075
Also needed for https://jira.sw.ru/browse/PSBM-47209
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
Acked-by: Andrey Ryabinin <aryabinin 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