public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/core: Prevent soft lockup during large user memory region cleanup
@ 2025-11-11  7:01 lirongqing
  2025-11-11  8:19 ` Junxian Huang
  2025-11-11 12:01 ` Leon Romanovsky
  0 siblings, 2 replies; 7+ messages in thread
From: lirongqing @ 2025-11-11  7:01 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky, linux-rdma; +Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

When a process exits with numerous large, pinned memory regions consisting
of 4KB pages, the cleanup of the memory region through __ib_umem_release()
may cause soft lockups. This is because unpin_user_page_range_dirty_lock()
is called in a tight loop for unpin and releasing page without yielding the
CPU.

Fix the soft lockup by adding cond_resched() calls in __ib_umem_release

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/infiniband/core/umem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index c5b6863..70c1520 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -59,6 +59,7 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d
 		unpin_user_page_range_dirty_lock(sg_page(sg),
 			DIV_ROUND_UP(sg->length, PAGE_SIZE), make_dirty);
 
+	cond_resched();
 	sg_free_append_table(&umem->sgt_append);
 }
 
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-13  7:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11  7:01 [PATCH] RDMA/core: Prevent soft lockup during large user memory region cleanup lirongqing
2025-11-11  8:19 ` Junxian Huang
2025-11-13  7:38   ` [外部邮件] " Li,Rongqing
2025-11-11 12:01 ` Leon Romanovsky
2025-11-11 12:09   ` [????] " Li,Rongqing
2025-11-12 14:19     ` Leon Romanovsky
2025-11-13  7:25       ` [????] " Li,Rongqing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox