* [PATCH] drm/i915: Kick the rps worker when changing the boost frequency
@ 2018-03-08 9:30 Chris Wilson
2018-03-08 9:53 ` Mika Kuoppala
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Chris Wilson @ 2018-03-08 9:30 UTC (permalink / raw)
To: intel-gfx; +Cc: Mika Kuoppala
The boost frequency is only applied from the RPS worker while someone is
waiting on a request and requested a boost. As such, when the user
wishes to change the frequency, we have to kick the worker in order to
re-evaluate whether to apply the boost frequency.
Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
drivers/gpu/drm/i915/i915_sysfs.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index b33d2158c234..d97463bb69ad 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct intel_rps *rps = &dev_priv->gt_pm.rps;
- u32 val;
+ bool boost = false;
ssize_t ret;
+ u32 val;
ret = kstrtou32(buf, 0, &val);
if (ret)
@@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
return -EINVAL;
mutex_lock(&dev_priv->pcu_lock);
- rps->boost_freq = val;
+ if (val != rps->boost_freq) {
+ rps->boost_freq = val;
+ boost = true;
+ }
mutex_unlock(&dev_priv->pcu_lock);
+ if (boost)
+ schedule_work(&rps->work);
return count;
}
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915: Kick the rps worker when changing the boost frequency
2018-03-08 9:30 [PATCH] drm/i915: Kick the rps worker when changing the boost frequency Chris Wilson
@ 2018-03-08 9:53 ` Mika Kuoppala
2018-03-08 10:04 ` Chris Wilson
2018-03-08 9:53 ` [PATCH v2] " Chris Wilson
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-08 9:53 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> The boost frequency is only applied from the RPS worker while someone is
> waiting on a request and requested a boost. As such, when the user
> wishes to change the frequency, we have to kick the worker in order to
> re-evaluate whether to apply the boost frequency.
>
> Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_sysfs.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index b33d2158c234..d97463bb69ad 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> {
> struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
> struct intel_rps *rps = &dev_priv->gt_pm.rps;
> - u32 val;
> + bool boost = false;
> ssize_t ret;
> + u32 val;
>
> ret = kstrtou32(buf, 0, &val);
> if (ret)
> @@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> return -EINVAL;
>
> mutex_lock(&dev_priv->pcu_lock);
> - rps->boost_freq = val;
> + if (val != rps->boost_freq) {
> + rps->boost_freq = val;
> + boost = true;
> + }
> mutex_unlock(&dev_priv->pcu_lock);
> + if (boost)
> + schedule_work(&rps->work);
>
Can the rps work handler handle a situation
where the powers are off? It bails out if we dont
have iir nor boost, which might be enough of a
safeguard.
If it can, why not just kick the rps work
unconditionally?
Further, on all other freq store entries in sysfs
update val and schedule unconditionally?
Then the handler would be the single entry to
re-evaluation and setting the hardware.
-Mika
> return count;
> }
> --
> 2.16.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] drm/i915: Kick the rps worker when changing the boost frequency
2018-03-08 9:30 [PATCH] drm/i915: Kick the rps worker when changing the boost frequency Chris Wilson
2018-03-08 9:53 ` Mika Kuoppala
@ 2018-03-08 9:53 ` Chris Wilson
2018-03-08 10:09 ` Mika Kuoppala
2018-03-08 11:23 ` ✓ Fi.CI.BAT: success for drm/i915: Kick the rps worker when changing the boost frequency (rev2) Patchwork
2018-03-08 13:39 ` ✗ Fi.CI.IGT: warning " Patchwork
3 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2018-03-08 9:53 UTC (permalink / raw)
To: intel-gfx; +Cc: Mika Kuoppala
The boost frequency is only applied from the RPS worker while someone is
waiting on a request and requested a boost. As such, when the user
wishes to change the frequency, we have to kick the worker in order to
re-evaluate whether to apply the boost frequency.
v2: Check num_waiters to decide if we should kick the worker to handle
boosting.
Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
drivers/gpu/drm/i915/i915_sysfs.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index b33d2158c234..e5e6f6bb2b05 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
{
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct intel_rps *rps = &dev_priv->gt_pm.rps;
- u32 val;
+ bool boost = false;
ssize_t ret;
+ u32 val;
ret = kstrtou32(buf, 0, &val);
if (ret)
@@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
return -EINVAL;
mutex_lock(&dev_priv->pcu_lock);
- rps->boost_freq = val;
+ if (val != rps->boost_freq) {
+ rps->boost_freq = val;
+ boost = atomic_read(&rps->num_waiters);
+ }
mutex_unlock(&dev_priv->pcu_lock);
+ if (boost)
+ schedule_work(&rps->work);
return count;
}
--
2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915: Kick the rps worker when changing the boost frequency
2018-03-08 9:53 ` Mika Kuoppala
@ 2018-03-08 10:04 ` Chris Wilson
0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-03-08 10:04 UTC (permalink / raw)
To: Mika Kuoppala, intel-gfx
Quoting Mika Kuoppala (2018-03-08 09:53:01)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
>
> > The boost frequency is only applied from the RPS worker while someone is
> > waiting on a request and requested a boost. As such, when the user
> > wishes to change the frequency, we have to kick the worker in order to
> > re-evaluate whether to apply the boost frequency.
> >
> > Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_sysfs.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> > index b33d2158c234..d97463bb69ad 100644
> > --- a/drivers/gpu/drm/i915/i915_sysfs.c
> > +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> > @@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> > {
> > struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
> > struct intel_rps *rps = &dev_priv->gt_pm.rps;
> > - u32 val;
> > + bool boost = false;
> > ssize_t ret;
> > + u32 val;
> >
> > ret = kstrtou32(buf, 0, &val);
> > if (ret)
> > @@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> > return -EINVAL;
> >
> > mutex_lock(&dev_priv->pcu_lock);
> > - rps->boost_freq = val;
> > + if (val != rps->boost_freq) {
> > + rps->boost_freq = val;
> > + boost = true;
> > + }
> > mutex_unlock(&dev_priv->pcu_lock);
> > + if (boost)
> > + schedule_work(&rps->work);
> >
>
> Can the rps work handler handle a situation
> where the powers are off? It bails out if we dont
> have iir nor boost, which might be enough of a
> safeguard.
Yes, we check whether the interrupts are enabled and do nothing if they
are not. We disable the interrupts when idling.
> If it can, why not just kick the rps work
> unconditionally?
That's the plan. I'm pushing this because I've a small series waiting
for the conflicts to resolve...
> Further, on all other freq store entries in sysfs
> update val and schedule unconditionally?
Coming soon :)
> Then the handler would be the single entry to
> re-evaluation and setting the hardware.
\o/
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] drm/i915: Kick the rps worker when changing the boost frequency
2018-03-08 9:53 ` [PATCH v2] " Chris Wilson
@ 2018-03-08 10:09 ` Mika Kuoppala
0 siblings, 0 replies; 7+ messages in thread
From: Mika Kuoppala @ 2018-03-08 10:09 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
Chris Wilson <chris@chris-wilson.co.uk> writes:
> The boost frequency is only applied from the RPS worker while someone is
> waiting on a request and requested a boost. As such, when the user
> wishes to change the frequency, we have to kick the worker in order to
> re-evaluate whether to apply the boost frequency.
>
> v2: Check num_waiters to decide if we should kick the worker to handle
> boosting.
>
> Fixes: 29ecd78d3b79 ("drm/i915: Define a separate variable and control for RPS waitboost frequency")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_sysfs.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
> index b33d2158c234..e5e6f6bb2b05 100644
> --- a/drivers/gpu/drm/i915/i915_sysfs.c
> +++ b/drivers/gpu/drm/i915/i915_sysfs.c
> @@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> {
> struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
> struct intel_rps *rps = &dev_priv->gt_pm.rps;
> - u32 val;
> + bool boost = false;
> ssize_t ret;
> + u32 val;
>
> ret = kstrtou32(buf, 0, &val);
> if (ret)
> @@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
> return -EINVAL;
>
> mutex_lock(&dev_priv->pcu_lock);
> - rps->boost_freq = val;
> + if (val != rps->boost_freq) {
> + rps->boost_freq = val;
> + boost = atomic_read(&rps->num_waiters);
> + }
> mutex_unlock(&dev_priv->pcu_lock);
> + if (boost)
> + schedule_work(&rps->work);
>
> return count;
> }
> --
> 2.16.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Kick the rps worker when changing the boost frequency (rev2)
2018-03-08 9:30 [PATCH] drm/i915: Kick the rps worker when changing the boost frequency Chris Wilson
2018-03-08 9:53 ` Mika Kuoppala
2018-03-08 9:53 ` [PATCH v2] " Chris Wilson
@ 2018-03-08 11:23 ` Patchwork
2018-03-08 13:39 ` ✗ Fi.CI.IGT: warning " Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-03-08 11:23 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Kick the rps worker when changing the boost frequency (rev2)
URL : https://patchwork.freedesktop.org/series/39586/
State : success
== Summary ==
Series 39586v2 drm/i915: Kick the rps worker when changing the boost frequency
https://patchwork.freedesktop.org/api/1.0/series/39586/revisions/2/mbox/
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:424s
fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:421s
fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:373s
fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:505s
fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:277s
fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:489s
fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:493s
fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:478s
fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:467s
fi-cfl-8700k total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:403s
fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:583s
fi-cfl-u total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:503s
fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:419s
fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:291s
fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:525s
fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:396s
fi-ilk-650 total:288 pass:227 dwarn:0 dfail:0 fail:1 skip:60 time:407s
fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:468s
fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:418s
fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:466s
fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:463s
fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:507s
fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:583s
fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:432s
fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:523s
fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:533s
fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:498s
fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:480s
fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:419s
fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:426s
fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:512s
fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:397s
Blacklisted hosts:
fi-cnl-drrs total:288 pass:257 dwarn:3 dfail:0 fail:0 skip:19 time:525s
e4a2b905cbe1a129e1252b6f80a97add0dfbff40 drm-tip: 2018y-03m-08d-10h-27m-13s UTC integration manifest
eb5fc14618f9 drm/i915: Kick the rps worker when changing the boost frequency
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8269/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* ✗ Fi.CI.IGT: warning for drm/i915: Kick the rps worker when changing the boost frequency (rev2)
2018-03-08 9:30 [PATCH] drm/i915: Kick the rps worker when changing the boost frequency Chris Wilson
` (2 preceding siblings ...)
2018-03-08 11:23 ` ✓ Fi.CI.BAT: success for drm/i915: Kick the rps worker when changing the boost frequency (rev2) Patchwork
@ 2018-03-08 13:39 ` Patchwork
3 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-03-08 13:39 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Kick the rps worker when changing the boost frequency (rev2)
URL : https://patchwork.freedesktop.org/series/39586/
State : warning
== Summary ==
---- Possible new issues:
Test drv_suspend:
Subgroup sysfs-reader:
pass -> SKIP (shard-snb)
Test kms_chv_cursor_fail:
Subgroup pipe-a-128x128-top-edge:
pass -> DMESG-WARN (shard-hsw)
---- Known issues:
Test gem_eio:
Subgroup in-flight-contexts:
incomplete -> PASS (shard-apl) fdo#105341
Test kms_chv_cursor_fail:
Subgroup pipe-b-256x256-bottom-edge:
dmesg-warn -> PASS (shard-snb) fdo#105185 +2
Test kms_cursor_crc:
Subgroup cursor-256x256-suspend:
pass -> INCOMPLETE (shard-hsw) fdo#103375
Test kms_flip:
Subgroup dpms-vs-vblank-race-interruptible:
pass -> FAIL (shard-hsw) fdo#103060
Subgroup flip-vs-expired-vblank:
fail -> PASS (shard-hsw) fdo#102887
Subgroup flip-vs-panning-vs-hang:
pass -> DMESG-WARN (shard-snb) fdo#103821
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047
Test pm_lpsp:
Subgroup screens-disabled:
pass -> FAIL (shard-hsw) fdo#104941
fdo#105341 https://bugs.freedesktop.org/show_bug.cgi?id=105341
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#104941 https://bugs.freedesktop.org/show_bug.cgi?id=104941
shard-apl total:3467 pass:1825 dwarn:1 dfail:0 fail:9 skip:1632 time:12283s
shard-hsw total:3383 pass:1719 dwarn:3 dfail:0 fail:3 skip:1656 time:11407s
shard-snb total:3467 pass:1360 dwarn:3 dfail:0 fail:2 skip:2102 time:6878s
Blacklisted hosts:
shard-kbl total:3381 pass:1858 dwarn:29 dfail:1 fail:9 skip:1483 time:9078s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8269/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-03-08 13:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 9:30 [PATCH] drm/i915: Kick the rps worker when changing the boost frequency Chris Wilson
2018-03-08 9:53 ` Mika Kuoppala
2018-03-08 10:04 ` Chris Wilson
2018-03-08 9:53 ` [PATCH v2] " Chris Wilson
2018-03-08 10:09 ` Mika Kuoppala
2018-03-08 11:23 ` ✓ Fi.CI.BAT: success for drm/i915: Kick the rps worker when changing the boost frequency (rev2) Patchwork
2018-03-08 13:39 ` ✗ Fi.CI.IGT: warning " Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.