[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z4bQwTL5VK6jGDZz@tassilo>
Date: Tue, 14 Jan 2025 13:01:53 -0800
From: Andi Kleen <ak@...ux.intel.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Tavian Barnes <tavianator@...ianator.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
James Clark <james.clark@...aro.org>, Leo Yan <leo.yan@...ux.dev>,
Charlie Jenkins <charlie@...osinc.com>,
Veronika Molnarova <vmolnaro@...hat.com>,
Michael Petlan <mpetlan@...hat.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, coresight@...ts.linaro.org
Subject: Re: [PATCH v1] perf sample: Make user_regs and intr_regs optional
On Mon, Jan 13, 2025 at 11:43:45AM -0800, Ian Rogers wrote:
> The struct dump_regs contains 512 bytes of cache_regs, meaning the two
> values in perf_sample contribute 1088 bytes of its total 1384 bytes
> size. Initializing this much memory has a cost reported by Tavian
> Barnes <tavianator@...ianator.com> as about 2.5% when running `perf
> script --itrace=i0`:
> https://lore.kernel.org/lkml/d841b97b3ad2ca8bcab07e4293375fb7c32dfce7.1736618095.git.tavianator@tavianator.com/
>
> Adrian Hunter <adrian.hunter@...el.com> replied that the zero
> initialization was necessary and couldn't simply be removed.
A much easier fix is to keep a global/heap allocate perf event
around that has these parts zeroed and only override the fields
needed and clear them afterwards.
(similar strategy as a slab constructor in the kernel)
-Andi
Powered by blists - more mailing lists