diff mbox

[5/5] drm/i915: debugfs entries for [e]LLC

Message ID 1372960927-1112-5-git-send-email-ben@bwidawsk.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky July 4, 2013, 6:02 p.m. UTC
To make users life a little easier figuring out what they have on their
system.

Ideally, I'd really like to report LLC size, but it turned out to be a
bit of a pain. Maybe I'll revisit it in the future.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Daniel Vetter July 4, 2013, 6:14 p.m. UTC | #1
On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
> To make users life a little easier figuring out what they have on their
> system.
> 
> Ideally, I'd really like to report LLC size, but it turned out to be a
> bit of a pain. Maybe I'll revisit it in the future.
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

I think a getparam for eLLC would be neat, so that usespace can use it to
tune working set sizes.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 3e36756..b75d0a6 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1941,6 +1941,19 @@ static int i915_dpio_info(struct seq_file *m, void *data)
>  	return 0;
>  }
>  
> +static int i915_llc(struct seq_file *m, void *data)
> +{
> +	struct drm_info_node *node = (struct drm_info_node *) m->private;
> +	struct drm_device *dev = node->minor->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +
> +	/* Size calculation for LLC is a bit of a pain. Ignore for now. */
> +	seq_printf(m, "LLC: %s\n", yesno(HAS_LLC(dev)));
> +	seq_printf(m, "eLLC: %zuMB\n", dev_priv->ellc_size);
> +
> +	return 0;
> +}
> +
>  static int
>  i915_wedged_get(void *data, u64 *val)
>  {
> @@ -2370,6 +2383,7 @@ static struct drm_info_list i915_debugfs_list[] = {
>  	{"i915_swizzle_info", i915_swizzle_info, 0},
>  	{"i915_ppgtt_info", i915_ppgtt_info, 0},
>  	{"i915_dpio", i915_dpio_info, 0},
> +	{"i915_llc", i915_llc, 0},
>  };
>  #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
>  
> -- 
> 1.8.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ben Widawsky July 4, 2013, 6:40 p.m. UTC | #2
On Thu, Jul 04, 2013 at 08:14:41PM +0200, Daniel Vetter wrote:
> On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
> > To make users life a little easier figuring out what they have on their
> > system.
> > 
> > Ideally, I'd really like to report LLC size, but it turned out to be a
> > bit of a pain. Maybe I'll revisit it in the future.
> > 
> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> 
> I think a getparam for eLLC would be neat, so that usespace can use it to
> tune working set sizes.
> -Daniel
>
And I assume drop debugfs?
Daniel Vetter July 4, 2013, 6:43 p.m. UTC | #3
On Thu, Jul 4, 2013 at 8:40 PM, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Thu, Jul 04, 2013 at 08:14:41PM +0200, Daniel Vetter wrote:
>> On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
>> > To make users life a little easier figuring out what they have on their
>> > system.
>> >
>> > Ideally, I'd really like to report LLC size, but it turned out to be a
>> > bit of a pain. Maybe I'll revisit it in the future.
>> >
>> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
>>
>> I think a getparam for eLLC would be neat, so that usespace can use it to
>> tune working set sizes.
>> -Daniel
>>
> And I assume drop debugfs?

Yeah, I guess the DRM_INFO message in dmesg should be good enough
then. For userspace's convenience we could even look into exposing the
LLC size with a getparam.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Ben Widawsky July 4, 2013, 6:46 p.m. UTC | #4
On Thu, Jul 04, 2013 at 08:43:58PM +0200, Daniel Vetter wrote:
> On Thu, Jul 4, 2013 at 8:40 PM, Ben Widawsky <ben@bwidawsk.net> wrote:
> > On Thu, Jul 04, 2013 at 08:14:41PM +0200, Daniel Vetter wrote:
> >> On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
> >> > To make users life a little easier figuring out what they have on their
> >> > system.
> >> >
> >> > Ideally, I'd really like to report LLC size, but it turned out to be a
> >> > bit of a pain. Maybe I'll revisit it in the future.
> >> >
> >> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> >>
> >> I think a getparam for eLLC would be neat, so that usespace can use it to
> >> tune working set sizes.
> >> -Daniel
> >>
> > And I assume drop debugfs?
> 
> Yeah, I guess the DRM_INFO message in dmesg should be good enough
> then. For userspace's convenience we could even look into exposing the
> LLC size with a getparam.
> -Daniel
>

I would like to do this since we have easy access to cpuid. I know Chad
really wants it. If you'll accept the patch, I'll write it.

> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Chad Versace July 9, 2013, 6:35 p.m. UTC | #5
On 07/04/2013 11:46 AM, Ben Widawsky wrote:
> On Thu, Jul 04, 2013 at 08:43:58PM +0200, Daniel Vetter wrote:
>> On Thu, Jul 4, 2013 at 8:40 PM, Ben Widawsky <ben@bwidawsk.net> wrote:
>>> On Thu, Jul 04, 2013 at 08:14:41PM +0200, Daniel Vetter wrote:
>>>> On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
>>>>> To make users life a little easier figuring out what they have on their
>>>>> system.
>>>>>
>>>>> Ideally, I'd really like to report LLC size, but it turned out to be a
>>>>> bit of a pain. Maybe I'll revisit it in the future.
>>>>>
>>>>> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
>>>>
>>>> I think a getparam for eLLC would be neat, so that usespace can use it to
>>>> tune working set sizes.
>>>> -Daniel
>>>>
>>> And I assume drop debugfs?
>>
>> Yeah, I guess the DRM_INFO message in dmesg should be good enough
>> then. For userspace's convenience we could even look into exposing the
>> LLC size with a getparam.
>> -Daniel
>>
>
> I would like to do this since we have easy access to cpuid. I know Chad
> really wants it. If you'll accept the patch, I'll write it.

I really want to know the cache sizes.

Actually, I didn't expect the kernel to do this for me. So, I've prototyped
a patch for Mesa to probe the cache sizes with CPUID. If the
kernel does that for Mesa, then I can likely drop my Mesa patch.
Ben Widawsky July 9, 2013, 8:16 p.m. UTC | #6
On Tue, Jul 09, 2013 at 11:35:38AM -0700, Chad Versace wrote:
> On 07/04/2013 11:46 AM, Ben Widawsky wrote:
> >On Thu, Jul 04, 2013 at 08:43:58PM +0200, Daniel Vetter wrote:
> >>On Thu, Jul 4, 2013 at 8:40 PM, Ben Widawsky <ben@bwidawsk.net> wrote:
> >>>On Thu, Jul 04, 2013 at 08:14:41PM +0200, Daniel Vetter wrote:
> >>>>On Thu, Jul 04, 2013 at 11:02:07AM -0700, Ben Widawsky wrote:
> >>>>>To make users life a little easier figuring out what they have on their
> >>>>>system.
> >>>>>
> >>>>>Ideally, I'd really like to report LLC size, but it turned out to be a
> >>>>>bit of a pain. Maybe I'll revisit it in the future.
> >>>>>
> >>>>>Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> >>>>
> >>>>I think a getparam for eLLC would be neat, so that usespace can use it to
> >>>>tune working set sizes.
> >>>>-Daniel
> >>>>
> >>>And I assume drop debugfs?
> >>
> >>Yeah, I guess the DRM_INFO message in dmesg should be good enough
> >>then. For userspace's convenience we could even look into exposing the
> >>LLC size with a getparam.
> >>-Daniel
> >>
> >
> >I would like to do this since we have easy access to cpuid. I know Chad
> >really wants it. If you'll accept the patch, I'll write it.
> 
> I really want to know the cache sizes.
> 
> Actually, I didn't expect the kernel to do this for me. So, I've prototyped
> a patch for Mesa to probe the cache sizes with CPUID. If the
> kernel does that for Mesa, then I can likely drop my Mesa patch.
> 

I think if we need to do the work, it makes sense to do it in the kernel
since the other components can easily take advantage of it. I can even
shoehorn it in to the existing LLC param.
Rodrigo Vivi July 13, 2013, 12:11 a.m. UTC | #7
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

I actually tested it too here on my ult... 0Mb ellc as expected...
unfortunately I don't have any cristallwell to test it for real ;)

On Thu, Jul 4, 2013 at 3:02 PM, Ben Widawsky <ben@bwidawsk.net> wrote:
> To make users life a little easier figuring out what they have on their
> system.
>
> Ideally, I'd really like to report LLC size, but it turned out to be a
> bit of a pain. Maybe I'll revisit it in the future.
>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 3e36756..b75d0a6 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1941,6 +1941,19 @@ static int i915_dpio_info(struct seq_file *m, void *data)
>         return 0;
>  }
>
> +static int i915_llc(struct seq_file *m, void *data)
> +{
> +       struct drm_info_node *node = (struct drm_info_node *) m->private;
> +       struct drm_device *dev = node->minor->dev;
> +       struct drm_i915_private *dev_priv = dev->dev_private;
> +
> +       /* Size calculation for LLC is a bit of a pain. Ignore for now. */
> +       seq_printf(m, "LLC: %s\n", yesno(HAS_LLC(dev)));
> +       seq_printf(m, "eLLC: %zuMB\n", dev_priv->ellc_size);
> +
> +       return 0;
> +}
> +
>  static int
>  i915_wedged_get(void *data, u64 *val)
>  {
> @@ -2370,6 +2383,7 @@ static struct drm_info_list i915_debugfs_list[] = {
>         {"i915_swizzle_info", i915_swizzle_info, 0},
>         {"i915_ppgtt_info", i915_ppgtt_info, 0},
>         {"i915_dpio", i915_dpio_info, 0},
> +       {"i915_llc", i915_llc, 0},
>  };
>  #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
>
> --
> 1.8.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3e36756..b75d0a6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1941,6 +1941,19 @@  static int i915_dpio_info(struct seq_file *m, void *data)
 	return 0;
 }
 
+static int i915_llc(struct seq_file *m, void *data)
+{
+	struct drm_info_node *node = (struct drm_info_node *) m->private;
+	struct drm_device *dev = node->minor->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	/* Size calculation for LLC is a bit of a pain. Ignore for now. */
+	seq_printf(m, "LLC: %s\n", yesno(HAS_LLC(dev)));
+	seq_printf(m, "eLLC: %zuMB\n", dev_priv->ellc_size);
+
+	return 0;
+}
+
 static int
 i915_wedged_get(void *data, u64 *val)
 {
@@ -2370,6 +2383,7 @@  static struct drm_info_list i915_debugfs_list[] = {
 	{"i915_swizzle_info", i915_swizzle_info, 0},
 	{"i915_ppgtt_info", i915_ppgtt_info, 0},
 	{"i915_dpio", i915_dpio_info, 0},
+	{"i915_llc", i915_llc, 0},
 };
 #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)