From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Kick the rps worker when changing the boost frequency
Date: Thu, 08 Mar 2018 12:09:44 +0200 [thread overview]
Message-ID: <87h8pqop3r.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180308095359.9301-1-chris@chris-wilson.co.uk>
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
next prev parent reply other threads:[~2018-03-08 10:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h8pqop3r.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox