Skip to content

Commit 928da37

Browse files
edumazetjgunthorpe
authored andcommitted
RDMA/umem: Add a schedule point in ib_umem_get()
Mapping as little as 64GB can take more than 10 seconds, triggering issues on kernels with CONFIG_PREEMPT_NONE=y. ib_umem_get() already splits the work in 2MB units on x86_64, adding a cond_resched() in the long-lasting loop is enough to solve the issue. Note that sg_alloc_table() can still use more than 100 ms, which is also problematic. This might be addressed later in ib_umem_add_sg_table(), adding new blocks in sgl on demand. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 395f2e8 commit 928da37

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/infiniband/core/umem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr,
261261
sg = umem->sg_head.sgl;
262262

263263
while (npages) {
264+
cond_resched();
264265
ret = pin_user_pages_fast(cur_base,
265266
min_t(unsigned long, npages,
266267
PAGE_SIZE /

0 commit comments

Comments
 (0)