Re: [PATCH v6 1/3] x86/fpu: Measure the Latency of XSAVES and XRSTORS

From: Ingo Molnar
Date: Fri Sep 15 2023 - 05:55:49 EST



* Yi Sun <yi.sun@xxxxxxxxx> wrote:

> > Instead of adding overhead to the regular FPU context saving/restoring
> > code paths, could you add a helper function that has tracing code
> > included, but which isn't otherwise used - and leave the regular code
> > with no tracing overhead?

> Furthermore, according doc static-keys.txt, the condition
> xrstor_tracing_enabled() would introduce only a minimal overhead when the
> trace is disabled. I believe it is a negligible impact on the performance
> when the trace is disabled.

Why introduce *any* extra overhead if it's possible to test the
functionality separately? The stated goal of the series is only to measure
FPU context switch performance, which doesn't require extra added overhead
to the actual context switch path.

[ Or if you want to convince reviewers that the overhead is indeed minimal,
please provide before/after generated assembly of the affected code that
demonstrates minimal impact. ]

Thanks,

Ingo