RDMA/umem: add a schedule point in ib_umem_get()
PATCH 1/1 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.
--- drivers/infiniband/core/umem.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/core/umem.c +1 -0
@@ -261,6 +261,7 @@ struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr, sg = umem->sg_head.sgl;while (npages) { +cond_resched (); ret = pin_user_pages_fast(cur_base, min_t(unsigned long, npages, PAGE_SIZE /
Signature · 1 line
2.28.0.rc0.142.g3c755180ce-goog
Jason Gunthorpe
maintainerQuoted 11 lines · Eric Dumazet
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 onx86_64, adding acond_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 inib_umem_add_sg_table(), adding new blocks in sgl on demand.
I have seen some patches in progress to do exactly this, the motivation is to reduce the memory consumption if a lot of pages are combined.
Quoted 7 lines
Signed-off-by Eric Dumazet <[email protected]>Cc Doug Ledford <[email protected]>Cc Jason Gunthorpe <[email protected]>--- drivers/infiniband/core/umem.c | 1 + 1 file changed, 1 insertion(+)
Why [PATCH net] ?
Anyhow, applied to rdma for-next
Thanks,
Jason
Quoted 9 lines · Jason Gunthorpe
Quoted 7 lines · Eric Dumazet
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 onx86_64, adding acond_resched()in the long-lasting loop is enough to solve the issue.
Quoted 8 lines
Quoted 4 lines
Note that
sg_alloc_table()can still use more than 100 ms, which is also problematic. This might be addressed later inib_umem_add_sg_table(), adding new blocks in sgl on demand.I have seen some patches in progress to do exactly this, the motivation is to reduce the memory consumption if a lot of pages are combined.
Nice ;)
Quoted 10 lines
Quoted 8 lines
Signed-off-by Eric Dumazet <[email protected]>Cc Doug Ledford <[email protected]>Cc Jason Gunthorpe <[email protected]>--- drivers/infiniband/core/umem.c | 1 + 1 file changed, 1 insertion(+)Why [PATCH net] ?
Sorry, I used a script that I normally use for net submissions, forgot to remove this tag ;)
Quoted 2 lines
Anyhow, applied to rdma for-next
Thanks !
Quoted 3 lines
Thanks,
Jason