Skip to content

Commit

Permalink
net/rds: Detect need of On-Demand-Paging memory registration
Browse files Browse the repository at this point in the history
Add code to check if memory intended for RDMA is FS-DAX-memory. RDS
will fail with error code EOPNOTSUPP if FS-DAX-memory is detected.

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 16, 2020
1 parent 8ffc324 commit c4c86ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/rds/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ void rds_rdma_drop_keys(struct rds_sock *rs)
static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
struct page **pages, int write)
{
unsigned int gup_flags = FOLL_LONGTERM;
int ret;

ret = get_user_pages_fast(user_addr, nr_pages, write ? FOLL_WRITE : 0,
pages);
if (write)
gup_flags |= FOLL_WRITE;

ret = get_user_pages_fast(user_addr, nr_pages, gup_flags, pages);
if (ret >= 0 && ret < nr_pages) {
while (ret--)
put_page(pages[ret]);
Expand Down

0 comments on commit c4c86ab

Please sign in to comment.