]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf header: Fix false warning when there are no duplicate cache entries
authorMichael Petlan <mpetlan@redhat.com>
Sun, 8 Dec 2019 16:20:56 +0000 (17:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Jan 2020 11:21:25 +0000 (12:21 +0100)
commit432bc6cbe187067c7a746b4d1e2c600e1af1b51f
tree6e759916d035f498e404329bf6a9aaab0e78b854
parent3635b27cc05888af1aa44e1cd67d2933884019be
perf header: Fix false warning when there are no duplicate cache entries

[ Upstream commit 28707826877f84bce0977845ea529cbdd08e4e8d ]

Before this patch, perf expected that there might be NPROC*4 unique
cache entries at max, however, it also expected that some of them would
be shared and/or of the same size, thus the final number of entries
would be reduced to be lower than NPROC*4. In case the number of entries
hadn't been reduced (was NPROC*4), the warning was printed.

However, some systems might have unusual cache topology, such as the
following two-processor KVM guest:

cpu  level  shared_cpu_list  size
  0     1         0           32K
  0     1         0           64K
  0     2         0           512K
  0     3         0           8192K
  1     1         1           32K
  1     1         1           64K
  1     2         1           512K
  1     3         1           8192K

This KVM guest has 8 (NPROC*4) unique cache entries, which used to make
perf printing the message, although there actually aren't "way too many
cpu caches".

v2: Removing unused argument.

v3: Unifying the way we obtain number of cpus.

v4: Removed '& UINT_MAX' construct which is redundant.

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
LPU-Reference: 20191208162056.20772-1-mpetlan@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/header.c