There is an asynchronous IO kernel function called io_uring introduced from Linux kernel 5.1, but the Docker image that uses it does not work on CentOS 8. Well, for those who know it, that's right.
As a rationale if you want to argue that the portability of Docker/Linux containers isn't all-purpose.
20.10 bash
4. For the time being, check the kernel in use with uname -a.
```(c)# uname -a```
(Execution result) root@17003dd74a2f:/liburing/examples# uname -a Linux 17003dd74a2f 5.8.0-33-generic #36-Ubuntu SMP Wed Dec 9 09:14:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
5. Install gcc and io_uring libraries, git.
```(c)# apt-get update```
```(c)# apt-get install -y build-essential liburing-dev git```
6. Get the sample program of io_uring.
https://blogs.oracle.com/linux/an-introduction-to-the-io_uring-asynchronous-io-framework
#### **`(c)# git clone https://github.com/axboe/liburing.git`**
(c)# cd liburing/examples
(c)# gcc -Wall -O2 -D_GNU_SOURCE -o io_uring-test io_uring-test.c -luring
8. Run the program. Of course, this works.
#### **`(c)# ./io_uring-test io_uring-test.c`**
(Execution result)
root@08ad6f4c804c:/liburing/examples# ./io_uring-test io_uring-test.c
Submitted=1, completed=1, bytes=2256
# docker commit io_uring-test io_uring-test
# docker save io_uring-test -o io_uring-test.tar
# Run the program on CentOS 8 Docker
1. 1. Create a virtual machine whose OS is CentOS 8.3.
https://www.centos.org/download/
2. 2. Install Docker.
https://docs.docker.com/engine/install/centos/
3. 3. Copy the previous Docker image (io_uring-test.tar) to your CentOS 8 machine and load it.
#### **`# docker load -i io_uring-test.tar`**
```tar
4. Start the container.
```# docker run -it --rm io_uring-test bash```
5. For the time being, check the kernel in use with uname -a. It should be 4.18, the same as the host CentOS 8.
```(c)# uname -a```
(Execution result) root@824c737193b6:/# uname -a Linux 824c737193b6 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
(By the way) root@824c737193b6:/liburing/examples# cat /etc/os-release NAME="Ubuntu" VERSION="20.10 (Groovy Gorilla)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.10" VERSION_ID="20.10" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=groovy UBUNTU_CODENAME=groovy
5. Run the sample program.
```(c)# cd liburing/examples/```
#### **`(c)# ./io_uring-test io_uring-test.c`**
(Execution result)
root@824c737193b6:/liburing/examples# ./io_uring-test io_uring-test.c
queue_init: Function not implemented
Well, it doesn't work.
Recommended Posts