Skip to content

Commit 7b018e2

Browse files
committed
perf map: Remove ->groups from 'struct map'
With this 'struct map' uses a bit over 3 cachelines: $ pahole -C map ~/bin/perf <SNIP> /* --- cacheline 2 boundary (128 bytes) --- */ u64 (*unmap_ip)(struct map *, u64); /* 128 8 */ struct dso * dso; /* 136 8 */ refcount_t refcnt; /* 144 4 */ /* size: 152, cachelines: 3, members: 18 */ /* sum members: 145, holes: 1, sum holes: 3 */ /* padding: 4 */ /* forced alignments: 2 */ /* last cacheline: 24 bytes */ } __attribute__((__aligned__(8))); $ We probably can move map->map/unmap_ip() moved to 'struct map_groups', that will shave more 16 bytes, getting this almost to two cachelines. Cc: Adrian Hunter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 3f662fc commit 7b018e2

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

tools/perf/util/map.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ void map__init(struct map *map, u64 start, u64 end, u64 pgoff, struct dso *dso)
140140
map->map_ip = map__map_ip;
141141
map->unmap_ip = map__unmap_ip;
142142
RB_CLEAR_NODE(&map->rb_node);
143-
map->groups = NULL;
144143
map->erange_warned = false;
145144
refcount_set(&map->refcnt, 1);
146145
}
@@ -388,7 +387,6 @@ struct map *map__clone(struct map *from)
388387
refcount_set(&map->refcnt, 1);
389388
RB_CLEAR_NODE(&map->rb_node);
390389
dso__get(map->dso);
391-
map->groups = NULL;
392390
}
393391

394392
return map;
@@ -582,7 +580,6 @@ void map_groups__init(struct map_groups *mg, struct machine *machine)
582580
void map_groups__insert(struct map_groups *mg, struct map *map)
583581
{
584582
maps__insert(&mg->maps, map);
585-
map->groups = mg;
586583
}
587584

588585
static void __maps__purge(struct maps *maps)
@@ -749,7 +746,6 @@ static void __map_groups__insert(struct map_groups *mg, struct map *map)
749746
{
750747
__maps__insert(&mg->maps, map);
751748
__maps__insert_name(&mg->maps, map);
752-
map->groups = mg;
753749
}
754750

755751
int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, FILE *fp)

tools/perf/util/map.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct map {
4242
u64 (*unmap_ip)(struct map *, u64);
4343

4444
struct dso *dso;
45-
struct map_groups *groups;
4645
refcount_t refcnt;
4746
};
4847

0 commit comments

Comments
 (0)