[openib-general] [PATCH] Use time_after_eq() instead of time_after() in queue_req()

Sean Hefty mshefty at ichips.intel.com
Tue Oct 17 10:28:57 PDT 2006


Acked-by: Sean Hefty <sean.hefty at intel.com>

Roland, this looks good for 2.6.20.  How would you like to handle pulling in 
patches like these?  Once OFA has git up, would it be easier to pull them into 
my git tree, then request that you pull from there, or does this work okay?


> 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 at in.ibm.com>
> --------
> diff -ruNp org/drivers/infiniband/core/addr.c new/drivers/infiniband/core/addr.c
> --- org/drivers/infiniband/core/addr.c	2006-10-09 16:54:37.000000000 +0530
> +++ new/drivers/infiniband/core/addr.c	2006-10-09 16:55:36.000000000 +0530
> @@ -118,7 +118,7 @@ static void queue_req(struct addr_req *r
>  
>  	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;
>  	}




More information about the general mailing list