Skip to content

Commit

Permalink
RDMA/addr: Use time_after_eq() instead of time_after() in queue_req()
Browse files Browse the repository at this point in the history
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: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Krishna Kumar authored and Roland Dreier committed Nov 29, 2006
1 parent e402227 commit f115db4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void queue_req(struct addr_req *req)

mutex_lock(&lock);
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;
}

Expand Down

0 comments on commit f115db4

Please sign in to comment.