[Intel-xe] [PATCH 3/3] drm/xe: Add sysfs entry to report per gt memory size

Upadhyay, Tejas tejas.upadhyay at intel.com
Mon May 8 10:44:03 UTC 2023



> -----Original Message-----
> From: Dixit, Ashutosh <ashutosh.dixit at intel.com>
> Sent: Friday, May 5, 2023 11:34 PM
> To: Rodrigo Vivi <rodrigo.vivi at kernel.org>
> Cc: Upadhyay, Tejas <tejas.upadhyay at intel.com>; Iddamsetty, Aravind
> <aravind.iddamsetty at intel.com>; intel-xe at lists.freedesktop.org; Vivi,
> Rodrigo <rodrigo.vivi at intel.com>
> Subject: Re: [PATCH 3/3] drm/xe: Add sysfs entry to report per gt memory
> size
> 
> On Fri, 05 May 2023 07:40:33 -0700, Rodrigo Vivi wrote:
> >
> > > > > @@ -50,9 +114,15 @@ int xe_gt_sysfs_init(struct xe_gt *gt)
> > > > >
> > > > >		gt->sysfs = &kg->base;
> > > > >
> > > > > +	gt->sysfs_defaults = kobject_create_and_add(".defaults",
> > > > > +gt->sysfs);
> > > >
> > > > what is the use of defaults??
> > >
> > > No use. There is no use I saw in i915 as well. But may be for some
> > > future use it is kept. Or I missed something. If want to remove, can
> > > be removed on objections.
> >
> > Cc: Ashutosh
> >
> > The defaults is used in i915 so Level-0/Sysman can perform the
> > restore_defaults operation.
> >
> > I believe it is a useful feature...
> 
> Yeah for RW sysfs attributes, i915 had the convention of exposing default
> values in /sys/class/.../.defaults (look at intel_gt_sysfs.c and
> sysfs_engines.c) so userland can restore default values if sysfs attributes had
> been previously modified. Level 0 was doing this in some cases.
> 

I looked into this little better, the entries which are going to be configured through CONFIGs would be having value and importance for defaults. For this particular sysfs entry we only have getter method (Read only). So I think defaults not required atleast for this case.

For entries like pre-empt_timeout_ms where configs coming from CONFIG file will need defaults which could go in its own code file may be (something like xe_engine_sysfs.c).

Thanks,
Tejas
> For xe, we can do the same or something different I guess.
> 
> Also, are we going to re-create sysfs as done in this series or use something
> like hwmon (it was being debated)?
> 
> Thanks.
> --
> Ashutosh


More information about the Intel-xe mailing list