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

net/rds: Detect need of On-Demand-Paging memory registration

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 <hans.westgaard.ry@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>

authored by

Hans Westgaard Ry and committed by
Leon Romanovsky
c4c86abb 8ffc3248

+4 -2
+4 -2
net/rds/rdma.c
··· 156 156 static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages, 157 157 struct page **pages, int write) 158 158 { 159 + unsigned int gup_flags = FOLL_LONGTERM; 159 160 int ret; 160 161 161 - ret = get_user_pages_fast(user_addr, nr_pages, write ? FOLL_WRITE : 0, 162 - pages); 162 + if (write) 163 + gup_flags |= FOLL_WRITE; 163 164 165 + ret = get_user_pages_fast(user_addr, nr_pages, gup_flags, pages); 164 166 if (ret >= 0 && ret < nr_pages) { 165 167 while (ret--) 166 168 put_page(pages[ret]);