* [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll()
@ 2016-12-06 11:37 Chris Wilson
2016-12-06 11:55 ` Eric Engestrom
2016-12-06 12:15 ` ✓ Fi.CI.BAT: success for " Patchwork
0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2016-12-06 11:37 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
If we cannot acquire the mode_config.lock immediately, just back off and
queue a new attempt after the poll interval. This is mostly to stop the
hung task spam when the system is deadlocked, but it will also lessen
the load (in such extreme cases).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/drm_probe_helper.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index ff9ba6f35248..0bf629354297 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -394,7 +394,11 @@ static void output_poll_execute(struct work_struct *work)
if (!drm_kms_helper_poll)
goto out;
- mutex_lock(&dev->mode_config.mutex);
+ if (!mutex_trylock(&dev->mode_config.mutex)) {
+ repoll = true;
+ goto out;
+ }
+
drm_for_each_connector(connector, dev) {
/* Ignore forced connectors. */
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll()
2016-12-06 11:37 [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll() Chris Wilson
@ 2016-12-06 11:55 ` Eric Engestrom
2016-12-06 12:41 ` [Intel-gfx] " Daniel Vetter
2016-12-06 12:15 ` ✓ Fi.CI.BAT: success for " Patchwork
1 sibling, 1 reply; 4+ messages in thread
From: Eric Engestrom @ 2016-12-06 11:55 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, dri-devel
On Tuesday, 2016-12-06 11:37:15 +0000, Chris Wilson wrote:
> If we cannot acquire the mode_config.lock immediately, just back off and
s/mode_config.lock/mode_config.mutex lock/ ?
> queue a new attempt after the poll interval. This is mostly to stop the
> hung task spam when the system is deadlocked, but it will also lessen
> the load (in such extreme cases).
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
> drivers/gpu/drm/drm_probe_helper.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index ff9ba6f35248..0bf629354297 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -394,7 +394,11 @@ static void output_poll_execute(struct work_struct *work)
> if (!drm_kms_helper_poll)
> goto out;
>
> - mutex_lock(&dev->mode_config.mutex);
> + if (!mutex_trylock(&dev->mode_config.mutex)) {
> + repoll = true;
> + goto out;
> + }
> +
> drm_for_each_connector(connector, dev) {
>
> /* Ignore forced connectors. */
> --
> 2.11.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* ✓ Fi.CI.BAT: success for drm: Don't block the kworker waiting for mode_config.lock in output_poll()
2016-12-06 11:37 [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll() Chris Wilson
2016-12-06 11:55 ` Eric Engestrom
@ 2016-12-06 12:15 ` Patchwork
1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-12-06 12:15 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm: Don't block the kworker waiting for mode_config.lock in output_poll()
URL : https://patchwork.freedesktop.org/series/16413/
State : success
== Summary ==
Series 16413v1 drm: Don't block the kworker waiting for mode_config.lock in output_poll()
https://patchwork.freedesktop.org/api/1.0/series/16413/revisions/1/mbox/
Test drv_module_reload:
Subgroup basic-reload-inject:
dmesg-warn -> PASS (fi-skl-6770hq)
fi-bdw-5557u total:247 pass:232 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:247 pass:207 dwarn:0 dfail:0 fail:0 skip:40
fi-bxt-t5700 total:247 pass:219 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-j1900 total:247 pass:219 dwarn:0 dfail:0 fail:0 skip:28
fi-byt-n2820 total:247 pass:215 dwarn:0 dfail:0 fail:0 skip:32
fi-hsw-4770 total:247 pass:227 dwarn:0 dfail:0 fail:0 skip:20
fi-hsw-4770r total:247 pass:227 dwarn:0 dfail:0 fail:0 skip:20
fi-ilk-650 total:247 pass:194 dwarn:0 dfail:0 fail:0 skip:53
fi-ivb-3520m total:247 pass:225 dwarn:0 dfail:0 fail:0 skip:22
fi-ivb-3770 total:247 pass:225 dwarn:0 dfail:0 fail:0 skip:22
fi-kbl-7500u total:247 pass:225 dwarn:0 dfail:0 fail:0 skip:22
fi-skl-6260u total:247 pass:233 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6700k total:247 pass:223 dwarn:3 dfail:0 fail:0 skip:21
fi-skl-6770hq total:247 pass:233 dwarn:0 dfail:0 fail:0 skip:14
fi-snb-2520m total:247 pass:215 dwarn:0 dfail:0 fail:0 skip:32
fi-snb-2600 total:247 pass:214 dwarn:0 dfail:0 fail:0 skip:33
9448ba081ec5f0b9a94d4c4e6206240097ec035e drm-tip: 2016y-12m-06d-09h-23m-53s UTC integration manifest
7c9a146 drm: Don't block the kworker waiting for mode_config.lock in output_poll()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3202/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-gfx] [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll()
2016-12-06 11:55 ` Eric Engestrom
@ 2016-12-06 12:41 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-12-06 12:41 UTC (permalink / raw)
To: Eric Engestrom; +Cc: intel-gfx, dri-devel
On Tue, Dec 06, 2016 at 11:55:14AM +0000, Eric Engestrom wrote:
> On Tuesday, 2016-12-06 11:37:15 +0000, Chris Wilson wrote:
> > If we cannot acquire the mode_config.lock immediately, just back off and
>
> s/mode_config.lock/mode_config.mutex lock/ ?
Fixed
>
> > queue a new attempt after the poll interval. This is mostly to stop the
> > hung task spam when the system is deadlocked, but it will also lessen
> > the load (in such extreme cases).
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
... and applied, thanks.
-Daniel
>
> > ---
> > drivers/gpu/drm/drm_probe_helper.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index ff9ba6f35248..0bf629354297 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -394,7 +394,11 @@ static void output_poll_execute(struct work_struct *work)
> > if (!drm_kms_helper_poll)
> > goto out;
> >
> > - mutex_lock(&dev->mode_config.mutex);
> > + if (!mutex_trylock(&dev->mode_config.mutex)) {
> > + repoll = true;
> > + goto out;
> > + }
> > +
> > drm_for_each_connector(connector, dev) {
> >
> > /* Ignore forced connectors. */
> > --
> > 2.11.0
> >
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-06 12:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 11:37 [PATCH] drm: Don't block the kworker waiting for mode_config.lock in output_poll() Chris Wilson
2016-12-06 11:55 ` Eric Engestrom
2016-12-06 12:41 ` [Intel-gfx] " Daniel Vetter
2016-12-06 12:15 ` ✓ Fi.CI.BAT: success for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox