Verification done on Zesty.
$ lsb_release -d Description: Ubuntu 17.04
$ wget 'https://launchpadlibrarian.net/337656213/file_146489.txt' -O io_setup_v2.c $ sudo apt-get --yes 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.10.0.37.37 $ sudo kexec --append="$(cat /proc/cmdline)" --initrd=/boot/initrd.img-4.10.0-37-generic /boot/vmlinux-4.10.0-37-generic ... $ uname -rv 4.10.0-37-generic #41-Ubuntu SMP Fri Oct 6 20:22:54 UTC 2017
$ ./io_setup_v2 1 65536 nr_events: 1, nr_requests: 65536 rc = -11, i = 204 ^Z [1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr 130560 $ cat /proc/sys/fs/aio-max-nr 65536 $ kill %%
Current kernel: --------------
$ sudo apt-get --yes install linux-image-generic=4.10.0.38.38 $ sudo kexec --append="$(cat /proc/cmdline)" --initrd=/boot/initrd.img-4.10.0-38-generic /boot/vmlinux-4.10.0-38-generic ... $ uname -rv 4.10.0-38-generic #42-Ubuntu SMP Tue Oct 10 13:22:54 UTC 2017 $ ./io_setup_v2 1 65536 nr_events: 1, nr_requests: 65536 rc = -12, i = 65514 ^Z [1]+ Stopped ./io_setup_v2 1 65536 $ cat /proc/sys/fs/aio-nr 65514 $ cat /proc/sys/fs/aio-max-nr 65536 $ kill %%
Verification done on Zesty.
$ lsb_release -d
Description: Ubuntu 17.04
$ wget 'https:/ /launchpadlibra rian.net/ 337656213/ file_146489. txt' -O io_setup_v2.c
$ sudo apt-get --yes 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.10.0. 37.37 /boot/initrd. img-4.10. 0-37-generic /boot/vmlinux- 4.10.0- 37-generic
$ sudo kexec --append="$(cat /proc/cmdline)" --initrd=
...
$ uname -rv
4.10.0-37-generic #41-Ubuntu SMP Fri Oct 6 20:22:54 UTC 2017
$ ./io_setup_v2 1 65536
nr_events: 1, nr_requests: 65536
rc = -11, i = 204
^Z
[1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr fs/aio- max-nr
130560
$ cat /proc/sys/
65536
$ kill %%
Current kernel:
--------------
$ sudo apt-get --yes install linux-image- generic= 4.10.0. 38.38 /boot/initrd. img-4.10. 0-38-generic /boot/vmlinux- 4.10.0- 38-generic fs/aio- max-nr
$ sudo kexec --append="$(cat /proc/cmdline)" --initrd=
...
$ uname -rv
4.10.0-38-generic #42-Ubuntu SMP Tue Oct 10 13:22:54 UTC 2017
$ ./io_setup_v2 1 65536
nr_events: 1, nr_requests: 65536
rc = -12, i = 65514
^Z
[1]+ Stopped ./io_setup_v2 1 65536
$ cat /proc/sys/fs/aio-nr
65514
$ cat /proc/sys/
65536
$ kill %%