From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Ben Widawsky <ben@bwidawsk.net>, Daisy Sun <daisy.sun@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915: Debugfs disable RPS boost and idle
Date: Tue, 29 Apr 2014 11:28:05 +0300 [thread overview]
Message-ID: <20140429082805.GA18465@intel.com> (raw)
In-Reply-To: <20140429064841.GD3463@nuc-i3427.alporthouse.com>
On Tue, Apr 29, 2014 at 07:48:41AM +0100, Chris Wilson wrote:
> On Mon, Apr 28, 2014 at 07:20:17PM -0700, Ben Widawsky wrote:
> > On Mon, Apr 28, 2014 at 01:53:52PM -0700, Daisy Sun wrote:
> > > RP frequency request is affected by 2 modules: normal turbo
> > > algorithm and RPS boost algorithm. By adding RPS boost algorithm
> > > to the mix, the final frequency becomes relatively unpredictable.
> > > Add a switch to enable/disable RPS boost functionality. When
> > > disabled, RP frequency will follow the normal turbo algorithm only.
> > >
> > > Intention: when boost and idle are disabled, we have a clear vision
> > > of turbo algorithm. It‘s very helpful to verify if the turbo
> > > algorithm is working as expected.
> > > Without debugfs hooks, the RPS boost or idle may kicks in at
> > > anytime and any circumstances.
> > >
> > > V1->V2: Follow Daniel's comment to explain the intention.
> > >
> > > Signed-off-by: Daisy Sun <daisy.sun@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/i915_debugfs.c | 40 +++++++++++++++++++++++++++++++++++++
> > > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > > drivers/gpu/drm/i915/intel_pm.c | 8 ++++++--
> > > 3 files changed, 47 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > > index 1e83ae4..ff71214 100644
> > > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > > @@ -3486,6 +3486,45 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_drop_caches_fops,
> > > i915_drop_caches_get, i915_drop_caches_set,
> > > "0x%08llx\n");
> > >
> > > +static int i915_rps_disable_boost_get(void *data, u64 *val)
> > > +{
> > > + struct drm_device *dev = data;
> > > + struct drm_i915_private *dev_priv = dev->dev_private;
> > > +
> > > + if (INTEL_INFO(dev)->gen < 6)
> > > + return -ENODEV;
> > > +
> > > + *val = dev_priv->rps.debugfs_disable_boost;
> > > +
> > > + return 0;
> > > +}
> > > +
> > > +static int i915_rps_disable_boost_set(void *data, u64 val)
> > > +{
> > > + struct drm_device *dev = data;
> > > + struct drm_i915_private *dev_priv = dev->dev_private;
> > > + int ret;
> > > +
> > > + flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> >
> > I'm not really sure why you feel it's necessary to flush the wq here.
> > Note that you have no real safety since you cannot acquire the lock, and
> > another event can get queued up after the flush. In other words,
> > whatever you're trying to do probably can fail.
> >
> > Also note that without this, a simple atomic_t would suffice for
> > debugfs_disable_boost.
>
> Simple? That puts another locked instruction on the common side as
> opposed to taking the mutex inside debugfs. Personally I'd complain much
> more about the lack of CODING_STYLE and good naming.
Also it's just a single bool and it doesn't matter if the value changes
while someone is holding struct_mutex, so no atomic_t or struct_mutex
necessary here.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2014-04-29 8:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 20:53 [PATCH v2] drm/i915: Debugfs disable RPS boost and idle Daisy Sun
2014-04-29 2:20 ` Ben Widawsky
2014-04-29 6:48 ` Chris Wilson
2014-04-29 8:28 ` Ville Syrjälä [this message]
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=20140429082805.GA18465@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ben@bwidawsk.net \
--cc=chris@chris-wilson.co.uk \
--cc=daisy.sun@intel.com \
--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 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.