Re: [PATCHv2 net-next 1/1] net: rds: use memset to optimize the recv

2018-09-17 Thread David Miller
From: Zhu Yanjun 
Date: Sun, 16 Sep 2018 22:49:30 -0400

> The function rds_inc_init is in recv process. To use memset can optimize
> the function rds_inc_init.
> The test result:
> 
>  Before:
>  1) + 24.950 us   |rds_inc_init [rds]();
>  After:
>  1) + 10.990 us   |rds_inc_init [rds]();
> 
> Acked-by: Santosh Shilimkar 
> Signed-off-by: Zhu Yanjun 
> ---
> V1->V2: a new patch for net-next

Applied.


[PATCHv2 net-next 1/1] net: rds: use memset to optimize the recv

2018-09-16 Thread Zhu Yanjun
The function rds_inc_init is in recv process. To use memset can optimize
the function rds_inc_init.
The test result:

 Before:
 1) + 24.950 us   |rds_inc_init [rds]();
 After:
 1) + 10.990 us   |rds_inc_init [rds]();

Acked-by: Santosh Shilimkar 
Signed-off-by: Zhu Yanjun 
---
V1->V2: a new patch for net-next
---
 net/rds/recv.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/rds/recv.c b/net/rds/recv.c
index 12719653188a..727639dac8a7 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -43,8 +43,6 @@
 void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
 struct in6_addr *saddr)
 {
-   int i;
-
refcount_set(>i_refcount, 1);
INIT_LIST_HEAD(>i_item);
inc->i_conn = conn;
@@ -52,8 +50,7 @@ void rds_inc_init(struct rds_incoming *inc, struct 
rds_connection *conn,
inc->i_rdma_cookie = 0;
inc->i_rx_tstamp = ktime_set(0, 0);
 
-   for (i = 0; i < RDS_RX_MAX_TRACES; i++)
-   inc->i_rx_lat_trace[i] = 0;
+   memset(inc->i_rx_lat_trace, 0, sizeof(inc->i_rx_lat_trace));
 }
 EXPORT_SYMBOL_GPL(rds_inc_init);
 
-- 
2.17.1