Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Before the commit 490ea5967b0d ("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 490ea5967b0d ("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 490ea5967b0d ("RDS: IB: move FMR code to its own file")
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>

authored by

Zhu Yanjun and committed by
David S. Miller
4b9fc714 6819e3f6

+11 -3
+11
net/rds/ib_fmr.c
··· 44 44 else 45 45 pool = rds_ibdev->mr_1m_pool; 46 46 47 + if (atomic_read(&pool->dirty_count) >= pool->max_items / 10) 48 + queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10); 49 + 50 + /* Switch pools if one of the pool is reaching upper limit */ 51 + if (atomic_read(&pool->dirty_count) >= pool->max_items * 9 / 10) { 52 + if (pool->pool_type == RDS_IB_MR_8K_POOL) 53 + pool = rds_ibdev->mr_1m_pool; 54 + else 55 + pool = rds_ibdev->mr_8k_pool; 56 + } 57 + 47 58 ibmr = rds_ib_try_reuse_ibmr(pool); 48 59 if (ibmr) 49 60 return ibmr;
-3
net/rds/ib_rdma.c
··· 454 454 struct rds_ib_mr *ibmr = NULL; 455 455 int iter = 0; 456 456 457 - if (atomic_read(&pool->dirty_count) >= pool->max_items_soft / 10) 458 - queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10); 459 - 460 457 while (1) { 461 458 ibmr = rds_ib_reuse_mr(pool); 462 459 if (ibmr)