diff options
author | Ian Rogers <irogers@google.com> | 2024-02-29 21:36:45 -0800 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2024-03-03 22:52:13 -0800 |
commit | 7bfc84b23e750d746e5c6723270b9c7f92cfa88c (patch) | |
tree | f75a8dd94f2f6493d1359181da1b11f18cf395a2 /tools/perf | |
parent | 412a2ff473ac01b195eb38c0853ce065b524b2e2 (diff) |
perf threads: Reduce table size from 256 to 8
The threads data structure is an array of hashmaps, previously
rbtrees. The two levels allows for a fixed outer array where access is
guarded by rw_semaphores. Commit 91e467bc568f ("perf machine: Use
hashtable for machine threads") sized the outer table at 256 entries
to avoid future scalability problems, however, this means the threads
struct is sized at 30,720 bytes. As the hashmaps allow O(1) access for
the common find/insert/remove operations, lower the number of entries
to 8. This reduces the size overhead to 960 bytes.
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240301053646.1449657-8-irogers@google.com
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/threads.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/threads.h b/tools/perf/util/threads.h index d03bd91a7769..da68d2223f18 100644 --- a/tools/perf/util/threads.h +++ b/tools/perf/util/threads.h @@ -7,7 +7,7 @@ struct thread; -#define THREADS__TABLE_BITS 8 +#define THREADS__TABLE_BITS 3 #define THREADS__TABLE_SIZE (1 << THREADS__TABLE_BITS) struct threads_table_entry { |