Re: [PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

From: Ilpo Järvinen
Date: Fri May 31 2024 - 08:51:58 EST


On Thu, 30 May 2024, Reinette Chatre wrote:

> Hi Ilpo,
>
> On 5/30/24 4:11 AM, Ilpo Järvinen wrote:
> > On Tue, 28 May 2024, Reinette Chatre wrote:
> > > On 5/28/24 3:19 AM, Ilpo Järvinen wrote:
> > > > On Fri, 24 May 2024, Ilpo Järvinen wrote:
> > > > > On Fri, 24 May 2024, Reinette Chatre wrote:
> > > > > > On 5/24/24 12:57 AM, Ilpo Järvinen wrote:
> > > > > > > On Thu, 23 May 2024, Reinette Chatre wrote:
>
> ...
>
> > > > > > It is not necessary to open and close the file every time a value
> > > > > > needs
> > > > > > to be read from it.
> > > >
> > > > I'm bit unsure where to go with this. While I could change the code to
> > > > match what you described, I realized with the two files approach there's
> > > > no need to do even review/lseek() call during the measurement. It might
> > > > not be very significant compared with the open that was there initially
> > > > but it's still extra.
> > >
> > > We are discussing the resctrl selftests that will accompany the resctrl
> > > filesystem in the kernel. When in doubt on how to interact with resctrl
> > > users
> > > use the selftests as reference. Needing to open and close a resctrl file
> > > every time a value needs to be read from it is not the correct guidance.
> >
> > That's actually a different goal from the earlier, but I've no problem
> > adjusting to it.
> >
> > Initially, this open/close() refactoring was made because of another goal
> > which was to avoid doing extra syscalls during the test.
> >
>
> It is not clear what you hint at here. Reading twice from an open file
> should not be a huge adjustment so it is not clear to me how this results
> in a big change to this work. As I understand this does match with original
> goal
> of reducing syscalls since the file need not be opened and closed twice.

What I tried to say is that with a single file, the test uses rewind()
that also needs to do a syscall within the test period, whereas if the
file is opened twice in advance rewind() won't be needed.

But I've converted it into single file for the sake of serving as an
example for other resctrl users.

--
i.