mbox series

[for,7.1,v1,0/8] memory leaks and speed tweaks

Message ID 20220811151413.3350684-1-alex.bennee@linaro.org
Headers show
Series memory leaks and speed tweaks | expand

Message

Alex Bennée Aug. 11, 2022, 3:14 p.m. UTC
Hi,

I've been collecting a number of small fixes since the tree was
frozen. I've been mostly focusing on improving the reliability of the
avocado tests and seeing if there are any low hanging fruit for
improving the performance.

The linux-user patch is a v2 fixing the obvious de-reference I missed
in v1 and prevents a memory leak in highly threaded code. Laurent may
want to cherry-pick himself if he wants to re-run the LTP tests before
merging although I hand ran the ones he mentioned failing and they all
work (for me at least ;-).

The CPUClass caching patches are a clean-up from my earlier hacky RFC
and shave a bit more time of the execution of particularly heavy IO
executions. The same is true of the SSI fixes.

The avocado fixes are band-aids over a wider issue which is we
currently can't cleanly wait for prompts that don't end in a newline.
However they should improve the situation of stuck tests a bit.

Finally the trace_dstate fix is some left over work from the TCG based
tracing that was pulled earlier this year. There is still the question
of what to do about per-vcpu trace points but they are all currently
called direct from C code so don't concern an TCG code.

I'm still going through the > 30s avocado tests on an --enable-debug
build. The two behemoths (BootLinuxAarch64.test_virt_tcg_gicv2/3)
should be ameliorated by better TB invalidation which rth is currently
cooking up patches for. I've still got to profile
BootLinuxS390X.test_s390_ccw_virtio_tcg,
ReplayKernelNormal.test_x86_64_pc, BootLinuxConsole.test_ppc_powernv8
and BootLinuxConsole.test_ppc_powernv9 which are kings of the
check-avocado time hill to see if there is anything obvious there.

The following patches still need review:

 - accel/tcg: remove trace_vcpu_dstate TB checking
 - tests/avocado: add timeout to the aspeed tests
 - ssi: cache SSIPeripheralClass to avoid GET_CLASS()
 - cputlb: used cached CPUClass in our hot-paths
 - hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
 - cpu: cache CPUClass in CPUState for hot code paths
   
Alex Bennée (8):
  linux-user: un-parent OBJECT(cpu) when closing thread
  cpu: cache CPUClass in CPUState for hot code paths
  hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
  cputlb: used cached CPUClass in our hot-paths
  ssi: cache SSIPeripheralClass to avoid GET_CLASS()
  tests/avocado: add timeout to the aspeed tests
  tests/avocado: apply a band aid to aspeed-evb login
  accel/tcg: remove trace_vcpu_dstate TB checking

 accel/tcg/tb-hash.h             |  6 +++---
 include/exec/exec-all.h         |  3 ---
 include/hw/core/cpu.h           |  9 +++++++++
 include/hw/ssi/ssi.h            |  3 +++
 accel/tcg/cpu-exec.c            |  6 +-----
 accel/tcg/cputlb.c              | 15 ++++++---------
 accel/tcg/translate-all.c       | 13 ++-----------
 cpu.c                           |  9 ++++-----
 hw/core/cpu-sysemu.c            |  5 ++---
 hw/ssi/ssi.c                    | 18 ++++++++----------
 linux-user/syscall.c            | 13 +++++++------
 tests/avocado/machine_aspeed.py |  4 ++++
 12 files changed, 49 insertions(+), 55 deletions(-)

Comments

Peter Maydell Aug. 11, 2022, 5:05 p.m. UTC | #1
On Thu, 11 Aug 2022 at 16:24, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Hi,
>
> I've been collecting a number of small fixes since the tree was
> frozen. I've been mostly focusing on improving the reliability of the
> avocado tests and seeing if there are any low hanging fruit for
> improving the performance.

> Alex Bennée (8):
>   linux-user: un-parent OBJECT(cpu) when closing thread
>   cpu: cache CPUClass in CPUState for hot code paths
>   hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
>   cputlb: used cached CPUClass in our hot-paths
>   ssi: cache SSIPeripheralClass to avoid GET_CLASS()
>   tests/avocado: add timeout to the aspeed tests
>   tests/avocado: apply a band aid to aspeed-evb login
>   accel/tcg: remove trace_vcpu_dstate TB checking

Changes to tests/ is fine, and fixes for memory leaks
also if they've been well tested, but stuff like the
caching of class objects is really not 7.1 material
at this point in the release cycle, I think.

thanks
-- PMM
Alex Bennée Aug. 11, 2022, 6 p.m. UTC | #2
Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 11 Aug 2022 at 16:24, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> Hi,
>>
>> I've been collecting a number of small fixes since the tree was
>> frozen. I've been mostly focusing on improving the reliability of the
>> avocado tests and seeing if there are any low hanging fruit for
>> improving the performance.
>
>> Alex Bennée (8):
>>   linux-user: un-parent OBJECT(cpu) when closing thread
>>   cpu: cache CPUClass in CPUState for hot code paths
>>   hw/core/cpu-sysemu: used cached class in cpu_asidx_from_attrs
>>   cputlb: used cached CPUClass in our hot-paths
>>   ssi: cache SSIPeripheralClass to avoid GET_CLASS()
>>   tests/avocado: add timeout to the aspeed tests
>>   tests/avocado: apply a band aid to aspeed-evb login
>>   accel/tcg: remove trace_vcpu_dstate TB checking
>
> Changes to tests/ is fine, and fixes for memory leaks
> also if they've been well tested, but stuff like the
> caching of class objects is really not 7.1 material
> at this point in the release cycle, I think.

No worries - I can drop the caching stuff for 7.1 but at least people
can test it ;-)