Skip to content

Commit

Permalink
net/rds: Use prefetch for On-Demand-Paging MR
Browse files Browse the repository at this point in the history
Try prefetching pages when using On-Demand-Paging MR using
ib_advise_mr.

Signed-off-by: Hans Westgaard Ry <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
  • Loading branch information
Hans Westgaard Ry authored and Leon Romanovsky committed Jan 18, 2020
1 parent 2eafa17 commit b2dfc67
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/rds/ib_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents,
(IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_READ |
IB_ACCESS_REMOTE_WRITE | IB_ACCESS_REMOTE_ATOMIC |
IB_ACCESS_ON_DEMAND);
struct ib_sge sge = {};
struct ib_mr *ib_mr;

if (!rds_ibdev->odp_capable) {
Expand Down Expand Up @@ -602,6 +603,14 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents,
}
ibmr->u.mr = ib_mr;
ibmr->odp = 1;

sge.addr = virt_addr;
sge.length = length;
sge.lkey = ib_mr->lkey;

ib_advise_mr(rds_ibdev->pd,
IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,
IB_UVERBS_ADVISE_MR_FLAG_FLUSH, &sge, 1);
return ibmr;
}

Expand Down

0 comments on commit b2dfc67

Please sign in to comment.