[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ad30f769-97ee-48b0-b3e2-3bce93eaf205@linaro.org>
Date: Mon, 17 Feb 2025 15:20:05 +0000
From: James Clark <james.clark@...aro.org>
To: Ian Rogers <irogers@...gle.com>
Cc: 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>, Tim Chen
<tim.c.chen@...ux.intel.com>, Yicong Yang <yangyicong@...ilicon.com>,
Ravi Bangoria <ravi.bangoria@....com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, Kyle Meyer <kyle.meyer@....com>,
Leo Yan <leo.yan@....com>
Subject: Re: [PATCH v3] perf cpumap: Reduce cpu size from int to int16_t
On 10/02/2025 7:12 pm, Ian Rogers wrote:
> Fewer than 32k logical CPUs are currently supported by perf. A cpumap
> is indexed by an integer (see perf_cpu_map__cpu) yielding a perf_cpu
> that wraps a 4-byte int for the logical CPU - the wrapping is done
> deliberately to avoid confusing a logical CPU with an index into a
> cpumap. Using a 4-byte int within the perf_cpu is larger than required
> so this patch reduces it to the 2-byte int16_t. For a cpumap
> containing 16 entries this will reduce the array size from 64 to 32
> bytes. For very large servers with lots of logical CPUs the size
> savings will be greater.
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> v3. Add bounds checks as suggested by Leo Yan <leo.yan@....com>.
> v2. Rebase and tweak commit message add Reviewed-by: Tim Chen
> <tim.c.chen@...ux.intel.com>.
> ---
> tools/lib/perf/cpumap.c | 8 ++--
> tools/lib/perf/include/perf/cpumap.h | 3 +-
> tools/perf/util/cpumap.c | 68 +++++++++++++++++++---------
> tools/perf/util/env.c | 2 +-
> 4 files changed, 54 insertions(+), 27 deletions(-)
>
Reviewed-by: James Clark <james.clark@...aro.org>
Powered by blists - more mailing lists