All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] net: rds: use memset to optimize the recv
@ 2018-09-14  8:45 Zhu Yanjun
  2018-09-14 16:51 ` Santosh Shilimkar
  2018-09-16 22:36 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Zhu Yanjun @ 2018-09-14  8:45 UTC (permalink / raw)
  To: santosh.shilimkar, davem, netdev, linux-rdma, rds-devel

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]();

Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
 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 504cd6bcc54c..a9399ddbb7bf 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(&inc->i_refcount, 1);
 	INIT_LIST_HEAD(&inc->i_item);
 	inc->i_conn = conn;
@@ -53,8 +51,7 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
 	inc->i_rx_tstamp.tv_sec = 0;
 	inc->i_rx_tstamp.tv_usec = 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] net: rds: use memset to optimize the recv
  2018-09-14  8:45 [PATCH 1/1] net: rds: use memset to optimize the recv Zhu Yanjun
@ 2018-09-14 16:51 ` Santosh Shilimkar
  2018-09-16 22:36 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Santosh Shilimkar @ 2018-09-14 16:51 UTC (permalink / raw)
  To: Zhu Yanjun, davem, netdev, linux-rdma, rds-devel

On 9/14/2018 1:45 AM, Zhu Yanjun wrote:
> 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]();
> 
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
Looks good. Thanks !!

Acked-by: Santosh Shilimkar<santosh.shilimkar@oracle.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] net: rds: use memset to optimize the recv
  2018-09-14  8:45 [PATCH 1/1] net: rds: use memset to optimize the recv Zhu Yanjun
  2018-09-14 16:51 ` Santosh Shilimkar
@ 2018-09-16 22:36 ` David Miller
  2018-09-17  0:54   ` zhuyj
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2018-09-16 22:36 UTC (permalink / raw)
  To: yanjun.zhu; +Cc: santosh.shilimkar, netdev, linux-rdma, rds-devel

From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Fri, 14 Sep 2018 04:45:38 -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]();
> 
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>

This doesn't apply cleanly to net-next, please respin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] net: rds: use memset to optimize the recv
  2018-09-16 22:36 ` David Miller
@ 2018-09-17  0:54   ` zhuyj
  0 siblings, 0 replies; 4+ messages in thread
From: zhuyj @ 2018-09-17  0:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: yanjun.zhu, santosh.shilimkar, netdev, linux-rdma, rds-devel

 OK. I will send V2 for net-next very soon.

Zhu Yanjun

On Mon, Sep 17, 2018 at 6:38 AM David Miller <davem@davemloft.net> wrote:
>
> From: Zhu Yanjun <yanjun.zhu@oracle.com>
> Date: Fri, 14 Sep 2018 04:45:38 -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]();
> >
> > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
>
> This doesn't apply cleanly to net-next, please respin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-17  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-14  8:45 [PATCH 1/1] net: rds: use memset to optimize the recv Zhu Yanjun
2018-09-14 16:51 ` Santosh Shilimkar
2018-09-16 22:36 ` David Miller
2018-09-17  0:54   ` zhuyj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.