Patchwork [net-next,2/6] bonding: remove the no effect lock for bond_3ad_lacpdu_recv()

login
register
mail settings
Submitter dingtianhong
Date Aug. 30, 2013, 10:04 a.m.
Message ID <52206E3F.6090007@huawei.com>
Download mbox | patch
Permalink /patch/271208/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

dingtianhong - Aug. 30, 2013, 10:04 a.m.
There is no pointer needed read lock protection, remove the unnecessary lock
and improve performance for the 3ad recv path.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Nikolay Aleksandrov <nikolay@redhat.com>
---
 drivers/net/bonding/bond_3ad.c | 2 --
 1 file changed, 2 deletions(-)
Rick Jones - Aug. 30, 2013, 5:07 p.m.
On 08/30/2013 03:04 AM, Ding Tianhong wrote:
> There is no pointer needed read lock protection, remove the unnecessary lock
> and improve performance for the 3ad recv path.

Improve performance by how much?  For example, by how much is service 
demand lower on a netperf TCP_STREAM or TCP_RR test through a bond.  I 
suppose that applies not only to this specific patch to to the set as a 
whole.

rick jones


>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> Cc: Nikolay Aleksandrov <nikolay@redhat.com>
> ---
>   drivers/net/bonding/bond_3ad.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index 7a3860f..c134f43 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
> @@ -2494,9 +2494,7 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
>   	if (!lacpdu)
>   		return ret;
>
> -	read_lock(&bond->lock);
>   	ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
> -	read_unlock(&bond->lock);
>   	return ret;
>   }
>
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 7a3860f..c134f43 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2494,9 +2494,7 @@  int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
 	if (!lacpdu)
 		return ret;
 
-	read_lock(&bond->lock);
 	ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
-	read_unlock(&bond->lock);
 	return ret;
 }