AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] radeon: Use only a single work queue thread for crt
@ 2019-08-03  0:09 Andi Kleen
  2020-09-05 21:56 ` Paul Menzel
  2020-09-06  8:53 ` Christian König
  0 siblings, 2 replies; 7+ messages in thread
From: Andi Kleen @ 2019-08-03  0:09 UTC (permalink / raw)
  To: alexander.deucher-5C7GfCeVMHo
  Cc: Andi Kleen, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Andi Kleen <ak@linux.intel.com>

I got tired of seeing a lot of radeon-crt kernel threads in ps on my
workstation, one for each CPU and one for each display, which never use any CPU time.
Surely a single kernel thread is enough to handle the display.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/gpu/drm/radeon/radeon_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index bd52f15e6330..fb0ca688f6fe 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
 
 	drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
 	radeon_crtc->crtc_id = index;
-	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
+	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI|WQ_UNBOUND, 0);
 	rdev->mode_info.crtcs[index] = radeon_crtc;
 
 	if (rdev->family >= CHIP_BONAIRE) {
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2019-08-03  0:09 [PATCH] radeon: Use only a single work queue thread for crt Andi Kleen
@ 2020-09-05 21:56 ` Paul Menzel
  2020-09-06  8:53 ` Christian König
  1 sibling, 0 replies; 7+ messages in thread
From: Paul Menzel @ 2020-09-05 21:56 UTC (permalink / raw)
  To: Andi Kleen, Alexander Deucher, Christian König; +Cc: Andi Kleen, amd-gfx

Dear Andi,


Am 03.08.19 um 02:09 schrieb Andi Kleen:
> From: Andi Kleen <ak@linux.intel.com>
> 
> I got tired of seeing a lot of radeon-crt kernel threads in ps on my
> workstation, one for each CPU and one for each display, which never use any CPU time.
> Surely a single kernel thread is enough to handle the display.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>   drivers/gpu/drm/radeon/radeon_display.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index bd52f15e6330..fb0ca688f6fe 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
>   
>   	drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
>   	radeon_crtc->crtc_id = index;
> -	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
> +	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI|WQ_UNBOUND, 0);
>   	rdev->mode_info.crtcs[index] = radeon_crtc;
>   
>   	if (rdev->family >= CHIP_BONAIRE) {

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2019-08-03  0:09 [PATCH] radeon: Use only a single work queue thread for crt Andi Kleen
  2020-09-05 21:56 ` Paul Menzel
@ 2020-09-06  8:53 ` Christian König
  2020-09-06 16:02   ` Jan Vesely
  2020-09-06 23:47   ` Dave Airlie
  1 sibling, 2 replies; 7+ messages in thread
From: Christian König @ 2020-09-06  8:53 UTC (permalink / raw)
  To: Andi Kleen, alexander.deucher; +Cc: Andi Kleen, amd-gfx

Am 03.08.19 um 02:09 schrieb Andi Kleen:
> From: Andi Kleen <ak@linux.intel.com>
>
> I got tired of seeing a lot of radeon-crt kernel threads in ps on my
> workstation, one for each CPU and one for each display, which never use any CPU time.
> Surely a single kernel thread is enough to handle the display.

NAK, radeon blocks inside the kernel thread and those need to run in 
parallel or otherwise the hardware can hang.

Christian.

>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>   drivers/gpu/drm/radeon/radeon_display.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index bd52f15e6330..fb0ca688f6fe 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
>   
>   	drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
>   	radeon_crtc->crtc_id = index;
> -	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
> +	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI|WQ_UNBOUND, 0);
>   	rdev->mode_info.crtcs[index] = radeon_crtc;
>   
>   	if (rdev->family >= CHIP_BONAIRE) {

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2020-09-06  8:53 ` Christian König
@ 2020-09-06 16:02   ` Jan Vesely
  2020-09-07  8:25     ` Christian König
  2020-09-06 23:47   ` Dave Airlie
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Vesely @ 2020-09-06 16:02 UTC (permalink / raw)
  To: Koenig, Christian; +Cc: Alex Deucher, Andi Kleen, Andi Kleen, amd-gfx list


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

On Sun, Sep 6, 2020 at 4:54 AM Christian König <
ckoenig.leichtzumerken@gmail.com> wrote:

> Am 03.08.19 um 02:09 schrieb Andi Kleen:
> > From: Andi Kleen <ak@linux.intel.com>
> >
> > I got tired of seeing a lot of radeon-crt kernel threads in ps on my
> > workstation, one for each CPU and one for each display, which never use
> any CPU time.
> > Surely a single kernel thread is enough to handle the display.
>
> NAK, radeon blocks inside the kernel thread and those need to run in
> parallel or otherwise the hardware can hang.
>

Shouldn't WQ_UNBOUND create a new worker thread whenever all current
workers go to sleep/block (and the total number of worker threads is below
'max_active') ?

Jan

>
> Christian.
>
> >
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > ---
> >   drivers/gpu/drm/radeon/radeon_display.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_display.c
> b/drivers/gpu/drm/radeon/radeon_display.c
> > index bd52f15e6330..fb0ca688f6fe 100644
> > --- a/drivers/gpu/drm/radeon/radeon_display.c
> > +++ b/drivers/gpu/drm/radeon/radeon_display.c
> > @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct drm_device *dev,
> int index)
> >
> >       drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
> >       radeon_crtc->crtc_id = index;
> > -     radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
> WQ_HIGHPRI, 0);
> > +     radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
> WQ_HIGHPRI|WQ_UNBOUND, 0);
> >       rdev->mode_info.crtcs[index] = radeon_crtc;
> >
> >       if (rdev->family >= CHIP_BONAIRE) {
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>

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

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2020-09-06  8:53 ` Christian König
  2020-09-06 16:02   ` Jan Vesely
@ 2020-09-06 23:47   ` Dave Airlie
  2020-09-07  8:24     ` Christian König
  1 sibling, 1 reply; 7+ messages in thread
From: Dave Airlie @ 2020-09-06 23:47 UTC (permalink / raw)
  To: Koenig, Christian
  Cc: Deucher, Alexander, Andi Kleen, Andi Kleen, amd-gfx mailing list

On Sun, 6 Sep 2020 at 18:54, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 03.08.19 um 02:09 schrieb Andi Kleen:
> > From: Andi Kleen <ak@linux.intel.com>
> >
> > I got tired of seeing a lot of radeon-crt kernel threads in ps on my
> > workstation, one for each CPU and one for each display, which never use any CPU time.
> > Surely a single kernel thread is enough to handle the display.
>
> NAK, radeon blocks inside the kernel thread and those need to run in
> parallel or otherwise the hardware can hang.

Do we need one per cpu? or is one per crtc enough?

Dave.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2020-09-06 23:47   ` Dave Airlie
@ 2020-09-07  8:24     ` Christian König
  0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2020-09-07  8:24 UTC (permalink / raw)
  To: Dave Airlie
  Cc: Deucher, Alexander, Andi Kleen, Andi Kleen, amd-gfx mailing list

Am 07.09.20 um 01:47 schrieb Dave Airlie:
> On Sun, 6 Sep 2020 at 18:54, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
>> Am 03.08.19 um 02:09 schrieb Andi Kleen:
>>> From: Andi Kleen <ak@linux.intel.com>
>>>
>>> I got tired of seeing a lot of radeon-crt kernel threads in ps on my
>>> workstation, one for each CPU and one for each display, which never use any CPU time.
>>> Surely a single kernel thread is enough to handle the display.
>> NAK, radeon blocks inside the kernel thread and those need to run in
>> parallel or otherwise the hardware can hang.
> Do we need one per cpu? or is one per crtc enough?

One per CRTC is enough, but the patch description sounds like it creates 
only a global one.

Christian.

>
> Dave.

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] radeon: Use only a single work queue thread for crt
  2020-09-06 16:02   ` Jan Vesely
@ 2020-09-07  8:25     ` Christian König
  0 siblings, 0 replies; 7+ messages in thread
From: Christian König @ 2020-09-07  8:25 UTC (permalink / raw)
  To: Jan Vesely, Koenig, Christian
  Cc: Alex Deucher, Andi Kleen, Andi Kleen, amd-gfx list


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

Am 06.09.20 um 18:02 schrieb Jan Vesely:
>
>
> On Sun, Sep 6, 2020 at 4:54 AM Christian König 
> <ckoenig.leichtzumerken@gmail.com 
> <mailto:ckoenig.leichtzumerken@gmail.com>> wrote:
>
>     Am 03.08.19 um 02:09 schrieb Andi Kleen:
>     > From: Andi Kleen <ak@linux.intel.com <mailto:ak@linux.intel.com>>
>     >
>     > I got tired of seeing a lot of radeon-crt kernel threads in ps on my
>     > workstation, one for each CPU and one for each display, which
>     never use any CPU time.
>     > Surely a single kernel thread is enough to handle the display.
>
>     NAK, radeon blocks inside the kernel thread and those need to run in
>     parallel or otherwise the hardware can hang.
>
>
> Shouldn't WQ_UNBOUND create a new worker thread whenever all current 
> workers go to sleep/block (and the total number of worker threads is 
> below 'max_active') ?

If that is guaranteed then this is indeed sufficient, but the sentence 
"Surely a single kernel thread is enough to handle the display." sounded 
like it creates only a single one.

Christian.

>
> Jan
>
>
>     Christian.
>
>     >
>     > Signed-off-by: Andi Kleen <ak@linux.intel.com
>     <mailto:ak@linux.intel.com>>
>     > ---
>     >   drivers/gpu/drm/radeon/radeon_display.c | 2 +-
>     >   1 file changed, 1 insertion(+), 1 deletion(-)
>     >
>     > diff --git a/drivers/gpu/drm/radeon/radeon_display.c
>     b/drivers/gpu/drm/radeon/radeon_display.c
>     > index bd52f15e6330..fb0ca688f6fe 100644
>     > --- a/drivers/gpu/drm/radeon/radeon_display.c
>     > +++ b/drivers/gpu/drm/radeon/radeon_display.c
>     > @@ -682,7 +682,7 @@ static void radeon_crtc_init(struct
>     drm_device *dev, int index)
>     >
>     >  drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
>     >       radeon_crtc->crtc_id = index;
>     > -     radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
>     WQ_HIGHPRI, 0);
>     > +     radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
>     WQ_HIGHPRI|WQ_UNBOUND, 0);
>     >       rdev->mode_info.crtcs[index] = radeon_crtc;
>     >
>     >       if (rdev->family >= CHIP_BONAIRE) {
>
>     _______________________________________________
>     amd-gfx mailing list
>     amd-gfx@lists.freedesktop.org <mailto:amd-gfx@lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


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

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2020-09-07  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-03  0:09 [PATCH] radeon: Use only a single work queue thread for crt Andi Kleen
2020-09-05 21:56 ` Paul Menzel
2020-09-06  8:53 ` Christian König
2020-09-06 16:02   ` Jan Vesely
2020-09-07  8:25     ` Christian König
2020-09-06 23:47   ` Dave Airlie
2020-09-07  8:24     ` Christian König

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