Re: [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker

2020-04-13 Thread Alex Deucher
Can you make sure this lands in drm-misc?

Thanks,

Alex

On Fri, Apr 10, 2020 at 8:15 AM Koenig, Christian
 wrote:
>
>
>
> Am 10.04.2020 12:58 schrieb "Pan, Xinhui" :
>
> 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 
>
>
> Reviewed-by: Christian König 
>
> ---
>  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();
>
>  spin_lock(>lru_lock);
> -   while (!list_empty(>ddestroy)) {
> +   while (!list_empty(>ddestroy) && !need_resched()) {
>  struct ttm_buffer_object *bo;
>
>  bo = list_first_entry(>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


Re: [PATCH] drm/ttm: Break out the loops if need_resched in bo delayed delete worker

2020-04-10 Thread Koenig, Christian


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

Reviewed-by: Christian König 

---
 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();

 spin_lock(>lru_lock);
-   while (!list_empty(>ddestroy)) {
+   while (!list_empty(>ddestroy) && !need_resched()) {
 struct ttm_buffer_object *bo;

 bo = list_first_entry(>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


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

2020-04-10 Thread xinhui pan
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 
---
 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();
 
spin_lock(>lru_lock);
-   while (!list_empty(>ddestroy)) {
+   while (!list_empty(>ddestroy) && !need_resched()) {
struct ttm_buffer_object *bo;
 
bo = list_first_entry(>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