Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b888be5 authored by Zhu Yanjun's avatar Zhu Yanjun Committed by Greg Kroah-Hartman
Browse files

net: rds: exchange of 8K and 1M pool



[ Upstream commit 4b9fc7146249a6e0e3175d0acc033fdcd2bfcb17 ]

Before the commit 490ea596 ("RDS: IB: move FMR code to its own file"),
when the dirty_count is greater than 9/10 of max_items of 8K pool,
1M pool is used, Vice versa. After the commit 490ea596 ("RDS: IB: move
FMR code to its own file"), the above is removed. When we make the
following tests.

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

The following will appear.
"
connecting to 1.1.1.16:4000
negotiated options, tasks will start in 2 seconds
Starting up..header from 1.1.1.166:4001 to id 4001 bogus
..
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
   1    0    0     0.00     0.00     0.00    0.00 0.00 -1.00
...
"
So this exchange between 8K and 1M pool is added back.

Fixes: commit 490ea596 ("RDS: IB: move FMR code to its own file")
Signed-off-by: default avatarZhu Yanjun <yanjun.zhu@oracle.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50dd6796
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,17 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages)
	else
	else
		pool = rds_ibdev->mr_1m_pool;
		pool = rds_ibdev->mr_1m_pool;


	if (atomic_read(&pool->dirty_count) >= pool->max_items / 10)
		queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10);

	/* Switch pools if one of the pool is reaching upper limit */
	if (atomic_read(&pool->dirty_count) >=  pool->max_items * 9 / 10) {
		if (pool->pool_type == RDS_IB_MR_8K_POOL)
			pool = rds_ibdev->mr_1m_pool;
		else
			pool = rds_ibdev->mr_8k_pool;
	}

	ibmr = rds_ib_try_reuse_ibmr(pool);
	ibmr = rds_ib_try_reuse_ibmr(pool);
	if (ibmr)
	if (ibmr)
		return ibmr;
		return ibmr;
+0 −3
Original line number Original line Diff line number Diff line
@@ -442,9 +442,6 @@ struct rds_ib_mr *rds_ib_try_reuse_ibmr(struct rds_ib_mr_pool *pool)
	struct rds_ib_mr *ibmr = NULL;
	struct rds_ib_mr *ibmr = NULL;
	int iter = 0;
	int iter = 0;


	if (atomic_read(&pool->dirty_count) >= pool->max_items_soft / 10)
		queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10);

	while (1) {
	while (1) {
		ibmr = rds_ib_reuse_mr(pool);
		ibmr = rds_ib_reuse_mr(pool);
		if (ibmr)
		if (ibmr)