PhotonLibOS icon indicating copy to clipboard operation
PhotonLibOS copied to clipboard

init iouring failed

Open dean-river opened this issue 3 years ago • 3 comments
trafficstars

hello i follow the instractions of Build in the file README.md. But when i run PhotonLibOS/build/output/simple-example,i got this error bellow: 2022/08/02 11:06:40|INFO |th=0000000000641FB0|/home/root/workspace/PhotonLibOS/io/iouring-wrapper.cpp:495|new_iouring:Init event engine: iouring [is_master=1] 2022/08/02 11:06:40|WARN |th=0000000000641FB0|/home/root/workspace/PhotonLibOS/io/iouring-wrapper.cpp:74|init:iouring: current user has no permission to set unlimited RLIMIT_MEMLOCK, change to root? 2022/08/02 11:06:46|ERROR|th=0000000000641FB0|/home/root/workspace/PhotonLibOS/io/iouring-wrapper.cpp:84|init:iouring: failed to init queue errno=38(Function not implemented) 2022/08/02 11:06:46|INFO |th=0000000000641FB0|/home/root/workspace/PhotonLibOS/io/iouring-wrapper.cpp:49|~iouringEngine:Finish event engine: iouring [m_master=1] 2022/08/02 11:06:46|ERROR|th=0000000000641FB0|/home/root/workspace/PhotonLibOS/examples/simple/simple.cpp:46|main:failed to init photon environment

i gdb follow step into here static inline int ____sys_io_uring_setup(unsigned entries, struct io_uring_params *p) { #ifdef CONFIG_NOLIBC return __arch_impl_io_uring_setup(entries, p); #else int ret; ret = syscall(__NR_io_uring_setup, entries, p); return (ret < 0) ? -errno : ret; #endif }

syscall(__NR_io_uring_setup, entries, p); return -1, errno=38(Function not implemented)

my system is:CentOS Linux release 8.5.2111 linux kernel version is: 4.18.0

dean-river avatar Aug 02 '22 03:08 dean-river

https://github.com/alibaba/PhotonLibOS/blob/221f0d156680f790e07b0bdad64c16fbcc7a3a92/examples/simple/simple.cpp#L38-L44

  1. Your current user has no permission to set rlimit, just use root?
  2. Update kernel version, not less than 5.8 to run iouring
dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
dnf --enablerepo=elrepo-kernel install kernel-ml
dnf --enablerepo=elrepo-kernel install kernel-ml-{devel,headers}

beef9999 avatar Aug 02 '22 03:08 beef9999

update kernel is not easy for me, i change the event_engine to epool, now it ok, but i find two write error(or bug) in simple.cpp

image

line 70: should be if (server == nullptr) {

line 87 should be if (client == nullptr) {

dean-river avatar Aug 02 '22 09:08 dean-river

Yes, it's apparently a bug. Thanks for reporting. Fixed by https://github.com/alibaba/PhotonLibOS/pull/47

beef9999 avatar Aug 02 '22 10:08 beef9999