Verification done on Xenial v4.4-based kernel.
$ lsb_release -d Description: Ubuntu 16.04.3 LTS
$ wget 'https://launchpadlibrarian.net/337656213/file_146489.txt' -O io_setup_v2.c $ sudo apt-get install gcc libaio-dev $ gcc -o io_setup_v2 io_setup_v2.c -laio
Previous kernel: ---------------
$ sudo apt-get --yes install linux-image-generic=4.4.0.97.102 $ sudo kexec --append="$(cat /proc/cmdline)" --initrd=/boot/initrd.img-4.4.0-97-generic /boot/vmlinux-4.4.0-97-generic ... $ uname -rv 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:26:02 UTC 2017
$ ./io_setup_v2 1 65536 nr_events: 1, nr_requests: 65536 rc = -11, i = 409 ^Z [1]+ Stopped ./io_setup_v2 1 65536 $ cat /proc/sys/fs/aio-nr 130880 $ cat /proc/sys/fs/aio-max-nr 65536 $ kill %%
Current kernel: --------------
$ sudo apt-get --yes install linux-image-generic=4.4.0.98.103 $ sudo kexec --append="$(cat /proc/cmdline)" --initrd=/boot/initrd.img-4.4.0-98-generic /boot/vmlinux-4.4.0-98-generic ... $ uname -rv 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:23:01 UTC 2017
$ ./io_setup_v2 1 65536 nr_events: 1, nr_requests: 65536 rc = -12, i = 65515 ^Z [1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr 65515
$ cat /proc/sys/fs/aio-max-nr 65536
Verification done on Xenial v4.4-based kernel.
$ lsb_release -d
Description: Ubuntu 16.04.3 LTS
$ wget 'https:/ /launchpadlibra rian.net/ 337656213/ file_146489. txt' -O io_setup_v2.c
$ sudo apt-get install gcc libaio-dev
$ gcc -o io_setup_v2 io_setup_v2.c -laio
Previous kernel:
---------------
$ sudo apt-get --yes install linux-image- generic= 4.4.0.97. 102 /boot/initrd. img-4.4. 0-97-generic /boot/vmlinux- 4.4.0-97- generic
$ sudo kexec --append="$(cat /proc/cmdline)" --initrd=
...
$ uname -rv
4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:26:02 UTC 2017
$ ./io_setup_v2 1 65536 fs/aio- max-nr
nr_events: 1, nr_requests: 65536
rc = -11, i = 409
^Z
[1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr
130880
$ cat /proc/sys/
65536
$ kill %%
Current kernel:
--------------
$ sudo apt-get --yes install linux-image- generic= 4.4.0.98. 103 /boot/initrd. img-4.4. 0-98-generic /boot/vmlinux- 4.4.0-98- generic
$ sudo kexec --append="$(cat /proc/cmdline)" --initrd=
...
$ uname -rv
4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:23:01 UTC 2017
$ ./io_setup_v2 1 65536
nr_events: 1, nr_requests: 65536
rc = -12, i = 65515
^Z
[1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr
65515
$ cat /proc/sys/ fs/aio- max-nr
65536