Tang, Changqing
2009-09-02 19:53:13 UTC
Roland or Mellanox Engineers:
We setup completion channel for a completion queue. We want to check if there is any
event available, and suppose there is NO event on both completion channel and completion queue.
What we can do is:
1. call select() on completion channel with zero timeout and return 0.
2. call ibv_poll_cq() directly and return 0.
Question:
Which way has lower overhead ? We know select() has to switch to kernel mode, does ibv_poll_cq()
switch to kernel mode and may cause a context switch ?
Thanks.
--CQ Tang
We setup completion channel for a completion queue. We want to check if there is any
event available, and suppose there is NO event on both completion channel and completion queue.
What we can do is:
1. call select() on completion channel with zero timeout and return 0.
2. call ibv_poll_cq() directly and return 0.
Question:
Which way has lower overhead ? We know select() has to switch to kernel mode, does ibv_poll_cq()
switch to kernel mode and may cause a context switch ?
Thanks.
--CQ Tang