Re: [RFC PATCH 1/9] cxl/mem: Implement Get Event Records command

From: Ira Weiny
Date: Thu Sep 22 2022 - 00:16:23 EST


On Wed, Sep 21, 2022 at 05:36:42PM +0100, Jonathan Cameron wrote:
> On Tue, 20 Sep 2022 15:10:26 -0700
> Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
>
> > On Tue, Sep 20, 2022 at 01:23:29PM -0700, Jiang, Dave wrote:

[snip]

> > >
> > > And what gets printed
> > > to the trace buffer can be decoded data constructed from those fields by the
> > > kernel code. So with that you can have access both.
> > >
> >
> > Fast assigning the entire buffer + decoded versions will roughly double the
> > trace event size.
> >
> > Thinking through this a bit more there is a sticking point.
> >
> > The difficulty will be ensuring that any new field names are documented such
> > that when user space starts to look at them they can determine if that data
> > appears as a new field or as part of a reserved field.
> >
> > For example if user space needs to access data in the reserved data now it can
> > simply decode it. However, when that data becomes a field it no longer is part
> > of the reserved data. So what user space would need to do is look for the
> > field first (ie know the field name) and then if it does not appear extract it
> > from the reserved data.
> >
> > I'm now wondering if I've wasted my time decoding anything since the kernel
> > does not need to know anything about these fields. Because the above scenario
> > means that user space may get ugly over time.
> >
> > That said I don't think it will present any incompatibilities. So perhaps we
> > are ok?
>
> I favor decoding current record in kernel and packing it appropriately.
> If that means we don't provide some new data from a future version then such
> is life - the kernel needs upgrading. That information is unlikely to be
> crucial - it's probably just more detail.

Dave, Dan, and I discussed this further today. Dan expressed the same opinion.
So I'm going to remove all the reserved fields from the next version.

Thanks,
Ira