提交 f115db48 编写于 作者: K Krishna Kumar 提交者: Roland Dreier

RDMA/addr: Use time_after_eq() instead of time_after() in queue_req()

In queue_req(), use time_after_eq() instead of time_after()
for following reasons :

- Improves insert time if multiple entries with same time are
  present.
- set_timeout need not be called if entry with same time
  is added to the list (and that happens to be the entry
  with the smallest time), saving atomic/locking operations.
- Earlier entries with same time are deleted first (fifo).
Signed-off-by: NKrishna Kumar <krkumar2@in.ibm.com>
Acked-by: NSean Hefty <sean.hefty@intel.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 e4022274
...@@ -139,7 +139,7 @@ static void queue_req(struct addr_req *req) ...@@ -139,7 +139,7 @@ static void queue_req(struct addr_req *req)
mutex_lock(&lock); mutex_lock(&lock);
list_for_each_entry_reverse(temp_req, &req_list, list) { list_for_each_entry_reverse(temp_req, &req_list, list) {
if (time_after(req->timeout, temp_req->timeout)) if (time_after_eq(req->timeout, temp_req->timeout))
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册