android_kernel_sony_sdm845/net/rds
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Zhu Yanjun c0c08f0342 net: rds: fix memory leak in rds_ib_flush_mr_pool
[ Upstream commit 85cb928787eab6a2f4ca9d2a798b6f3bed53ced1 ]

When the following tests last for several hours, the problem will occur.

Server:
    rds-stress -r 1.1.1.16 -D 1M
Client:
    rds-stress -r 1.1.1.14 -s 1.1.1.16 -D 1M -T 30

The following will occur.

"
Starting up....
tsks   tx/s   rx/s  tx+rx K/s    mbi K/s    mbo K/s tx us/c   rtt us cpu
%
  1      0      0       0.00       0.00       0.00    0.00 0.00 -1.00
  1      0      0       0.00       0.00       0.00    0.00 0.00 -1.00
  1      0      0       0.00       0.00       0.00    0.00 0.00 -1.00
  1      0      0       0.00       0.00       0.00    0.00 0.00 -1.00
"
>From vmcore, we can find that clean_list is NULL.

>From the source code, rds_mr_flushd calls rds_ib_mr_pool_flush_worker.
Then rds_ib_mr_pool_flush_worker calls
"
 rds_ib_flush_mr_pool(pool, 0, NULL);
"
Then in function
"
int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
                         int free_all, struct rds_ib_mr **ibmr_ret)
"
ibmr_ret is NULL.

In the source code,
"
...
list_to_llist_nodes(pool, &unmap_list, &clean_nodes, &clean_tail);
if (ibmr_ret)
        *ibmr_ret = llist_entry(clean_nodes, struct rds_ib_mr, llnode);

/* more than one entry in llist nodes */
if (clean_nodes->next)
        llist_add_batch(clean_nodes->next, clean_tail, &pool->clean_list);
...
"
When ibmr_ret is NULL, llist_entry is not executed. clean_nodes->next
instead of clean_nodes is added in clean_list.
So clean_nodes is discarded. It can not be used again.
The workqueue is executed periodically. So more and more clean_nodes are
discarded. Finally the clean_list is NULL.
Then this problem will occur.

Fixes: 1bc144b625 ("net, rds, Replace xlist in net/rds/xlist.h with llist")
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-11 12:22:46 +02:00
..
af_rds.c
bind.c rds: fix refcount bug in rds_sock_addref 2019-02-12 19:45:00 +01:00
cong.c
connection.c
ib.c RDS: IB: Fix null pointer issue 2018-05-30 07:50:25 +02:00
ib.h
ib_cm.c rds: ib: Fix missing call to rds_ib_dev_put in rds_ib_setup_qp 2018-11-10 07:42:50 -08:00
ib_fmr.c net: rds: exchange of 8K and 1M pool 2019-05-02 09:32:05 +02:00
ib_frmr.c RDS: IB: fix 'passing zero to ERR_PTR()' warning 2018-09-15 09:43:00 +02:00
ib_mr.h
ib_rdma.c net: rds: fix memory leak in rds_ib_flush_mr_pool 2019-06-11 12:22:46 +02:00
ib_recv.c
ib_ring.c
ib_send.c RDS: RDMA: Fix the composite message user notification 2017-10-08 10:26:02 +02:00
ib_stats.c
ib_sysctl.c
info.c
info.h
Kconfig
loop.c rds: avoid unenecessary cong_update in loop transport 2018-07-22 14:27:39 +02:00
loop.h
Makefile
message.c
page.c
rdma.c RDS: null pointer dereference in rds_atomic_free_op 2018-01-17 09:38:53 +01:00
rdma_transport.c
rdma_transport.h
rds.h rds: avoid unenecessary cong_update in loop transport 2018-07-22 14:27:39 +02:00
rds_single_path.h
recv.c rds: avoid unenecessary cong_update in loop transport 2018-07-22 14:27:39 +02:00
send.c rds: MP-RDS may use an invalid c_path 2018-04-20 08:21:07 +02:00
stats.c
sysctl.c
tcp.c net: rds: force to destroy connection if t_sock is NULL in rds_tcp_kill_sock(). 2019-04-17 08:36:44 +02:00
tcp.h rds: tcp: atomically purge entries from rds_tcp_conn_list during netns delete 2018-02-25 11:05:43 +01:00
tcp_connect.c
tcp_listen.c rds: tcp: Sequence teardown of listen and acceptor sockets to avoid races 2017-12-14 09:28:20 +01:00
tcp_recv.c
tcp_send.c
tcp_stats.c
threads.c
transport.c