Hi, use_mq_eventfd will help with vcl but as you’ve noticed it won’t help for ldp because there we need to poll both vcl and linux fds. Because mutex-condvar notifications can’t be epolled we have to constantly switch between linux and vcl epolled fds. One option going forward would be to change ldp to detect if vcl is using mutex-condvars or eventfds and in case of the latter poll linux fds and the mq’s eventfd in a linux epoll.
Regards, Florin > On Oct 31, 2019, at 5:54 AM, wanghanlin <wanghan...@corp.netease.com> wrote: > > hi ALL, > I found app using VCL "epoll_wait" still occupy 70% cpu with "use_mq_eventfd" > configuration even if very little traffic. > Then I investigate code in ldp_epoll_pwait, vls_epoll_wait is called with > timeout equal to 0. > Then I have two questions: > 1. What problems can "use_mq_eventfd" solve? > 2.Any other way to decrease cpu usage? > Thanks! > > code in ldp_epoll_pwait: > do > { > if (!ldpw->epoll_wait_vcl) > { > rv = vls_epoll_wait (ep_vlsh, events, maxevents, 0); > if (rv > 0) > { > ldpw->epoll_wait_vcl = 1; > goto done; > } > else if (rv < 0) > { > errno = -rv; > rv = -1; > goto done; > } > } > else > ldpw->epoll_wait_vcl = 0; > > if (libc_epfd > 0) > { > rv = libc_epoll_pwait (libc_epfd, events, maxevents, 0, sigmask); > if (rv != 0) > goto done; > } > } > while ((timeout == -1) || (clib_time_now (&ldpw->clib_time) < max_time)); > > wanghanlin > > wanghan...@corp.netease.com > > <https://maas.mail.163.com/dashi-web-extend/html/proSignature.html?ftlId=1&name=wanghanlin&uid=wanghanlin%40corp.netease.com&iconUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&items=%5B%22wanghanlin%40corp.netease.com%22%5D&logoUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fqiyeicon%2F209a2912f40f6683af56bb7caff1cb54.png> > 签名由 网易邮箱大师 <https://mail.163.com/dashi/dlpro.html?from=mail81> 定制 > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > > View/Reply Online (#14413): https://lists.fd.io/g/vpp-dev/message/14413 > <https://lists.fd.io/g/vpp-dev/message/14413> > Mute This Topic: https://lists.fd.io/mt/40123765/675152 > <https://lists.fd.io/mt/40123765/675152> > Group Owner: vpp-dev+ow...@lists.fd.io <mailto:vpp-dev+ow...@lists.fd.io> > Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub > <https://lists.fd.io/g/vpp-dev/unsub> [fcoras.li...@gmail.com > <mailto:fcoras.li...@gmail.com>] > -=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#14420): https://lists.fd.io/g/vpp-dev/message/14420 Mute This Topic: https://lists.fd.io/mt/40123765/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-