dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker
@ 2020-04-10 10:58 xinhui pan
  0 siblings, 0 replies; 3+ messages in thread
From: xinhui pan @ 2020-04-10 10:58 UTC (permalink / raw)
  To: amd-gfx; +Cc: xinhui pan, christian.koenig, dri-devel

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.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 9e07c3f75156..c5b516fa4eae 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker
  2020-04-10 12:15 Koenig, Christian
@ 2020-04-13 15:35 ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-04-13 15:35 UTC (permalink / raw)
  To: Koenig, Christian; +Cc: Pan, Xinhui, amd-gfx, dri-devel

Can you make sure this lands in drm-misc?

Thanks,

Alex

On Fri, Apr 10, 2020 at 8:15 AM Koenig, Christian
<Christian.Koenig@amd.com> wrote:
>
>
>
> Am 10.04.2020 12:58 schrieb "Pan, Xinhui" <Xinhui.Pan@amd.com>:
>
> 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.
>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 9e07c3f75156..c5b516fa4eae 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -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
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker
@ 2020-04-10 12:15 Koenig, Christian
  2020-04-13 15:35 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Koenig, Christian @ 2020-04-10 12:15 UTC (permalink / raw)
  To: Pan, Xinhui; +Cc: dri-devel, amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 1160 bytes --]



Am 10.04.2020 12:58 schrieb "Pan, Xinhui" <Xinhui.Pan@amd.com>:
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.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 9e07c3f75156..c5b516fa4eae 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -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



[-- Attachment #1.2: Type: text/html, Size: 2531 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-04-13 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 10:58 [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker xinhui pan
2020-04-10 12:15 Koenig, Christian
2020-04-13 15:35 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).