Skip to contentSkip to conversation

drm/ttm: Break out the loops if need_resched in bo delayed delete worker

PATCH Koenig, Christian 2 participants 2 messages Apr 10, 2020 – Apr 13, 2020

Subsystems (3)
lore
Share & tools
lore

Koenig, Christian

author Reviewed-by
#0 lore raw

Am 10.04.2020 12:58 schrieb "Pan, Xinhui" <[email protected]>:
The delayed delete list is per device which might be very huge. And in a heavy workload test, the list might always not be empty. That will trigger any RCU stall warnings or softlockups in non-preemptible kernels Lets do break out the loops in that case.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
index 9e07c3f75156..c5b516fa4eae 100644
@@ -518,7 +518,7 @@ static bool ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool remove_all)
         INIT_LIST_HEAD(&removed);
 
         spin_lock(&glob->lru_lock);
-       while (!list_empty(&bdev->ddestroy)) {
+       while (!list_empty(&bdev->ddestroy) && !need_resched()) {
                 struct ttm_buffer_object *bo;
 
                 bo = list_first_entry(&bdev->ddestroy, struct ttm_buffer_object,

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#1 lore raw

Can you make sure this lands in drm-misc?

Thanks,

Alex

Quoted 36 lines · Christian

Am 10.04.2020 12:58 schrieb "Pan, Xinhui" <[email protected]>:

The delayed delete list is per device which might be very huge. And in a heavy workload test, the list might always not be empty. That will trigger any RCU stall warnings or softlockups in non-preemptible kernels Lets do break out the loops in that case.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +1 -2
index 9e07c3f75156..c5b516fa4eae 100644
@@ -518,7 +518,7 @@ static bool ttm_bo_delayed_delete(struct ttm_bo_device *bdev, bool remove_all)
         INIT_LIST_HEAD(&removed);
 
         spin_lock(&glob->lru_lock);
-       while (!list_empty(&bdev->ddestroy)) {
+       while (!list_empty(&bdev->ddestroy) && !need_resched()) {
                 struct ttm_buffer_object *bo;
 
                 bo = list_first_entry(&bdev->ddestroy, struct ttm_buffer_object,
--

2.17.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx