[openib-general] Re: [PATCH] Re: SDP_CONN_LOCK

Sean Hefty mshefty at ichips.intel.com
Fri Feb 18 16:15:04 PST 2005


Libor Michalek wrote:
>   Attached is a patch that replaces some of the connection macros with
> inline function. The two internal functions you mention were not removed.
> When the lock has no contention, which is the common case, those functions
> are never called which is why the code was split into a macro and funciton
> in the first place. The BH suffixes were replaced w/ IRQ.

Thanks.  See comments below...

> +#define SDP_CONN_LOCK_IRQ(conn, flags) \
>          spin_lock_irqsave(&((conn)->lock.slock), flags)

Can we just remove this macro?

> +#define SDP_CONN_UNLOCK_IRQ(conn, flags) \
>          spin_unlock_irqrestore(&((conn)->lock.slock), flags)

And this one?

> +static inline void sdp_conn_hold(struct sdp_opt *conn)
> +{
> +	atomic_inc(&conn->refcnt);
> +}

ditto...

> +static inline void sdp_conn_put(struct sdp_opt *conn)
> +{
> +	if (atomic_dec_and_test(&conn->refcnt)) {
> +
> +		(void)sdp_conn_destruct(conn);
> +	}
> +}

This one is a little more debatable, but for 2 lines, versus 1, I'd 
remove it.

- Sean



More information about the general mailing list