From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Clark Williams <williams@redhat.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 13/15] perf map: Remove ->groups from 'struct map'
Date: Tue, 12 Nov 2019 15:37:55 -0300 [thread overview]
Message-ID: <20191112183757.28660-14-acme@kernel.org> (raw)
In-Reply-To: <20191112183757.28660-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
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 <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-ymlv3nzpofv2fugnjnizkrwy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/map.c | 4 ----
tools/perf/util/map.h | 1 -
2 files changed, 5 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 27d8508f8a44..359846833a00 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -140,7 +140,6 @@ void map__init(struct map *map, u64 start, u64 end, u64 pgoff, struct dso *dso)
map->map_ip = map__map_ip;
map->unmap_ip = map__unmap_ip;
RB_CLEAR_NODE(&map->rb_node);
- map->groups = NULL;
map->erange_warned = false;
refcount_set(&map->refcnt, 1);
}
@@ -388,7 +387,6 @@ struct map *map__clone(struct map *from)
refcount_set(&map->refcnt, 1);
RB_CLEAR_NODE(&map->rb_node);
dso__get(map->dso);
- map->groups = NULL;
}
return map;
@@ -582,7 +580,6 @@ void map_groups__init(struct map_groups *mg, struct machine *machine)
void map_groups__insert(struct map_groups *mg, struct map *map)
{
maps__insert(&mg->maps, map);
- map->groups = mg;
}
static void __maps__purge(struct maps *maps)
@@ -749,7 +746,6 @@ static void __map_groups__insert(struct map_groups *mg, struct map *map)
{
__maps__insert(&mg->maps, map);
__maps__insert_name(&mg->maps, map);
- map->groups = mg;
}
int map_groups__fixup_overlappings(struct map_groups *mg, struct map *map, FILE *fp)
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index c3614195ddc7..365deb6375ab 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -42,7 +42,6 @@ struct map {
u64 (*unmap_ip)(struct map *, u64);
struct dso *dso;
- struct map_groups *groups;
refcount_t refcnt;
};
--
2.21.0
next prev parent reply other threads:[~2019-11-12 18:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 18:37 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 01/15] perf map: Use map->dso->kernel + map__kmaps() in map__kmaps() Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 02/15] perf symbols: Stop using map->groups, we can use kmaps instead Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 03/15] perf map_groups: Pass the object to map_groups__find_ams() Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 04/15] perf tools: Add map_groups to 'struct addr_location' Arnaldo Carvalho de Melo
2019-11-29 13:40 ` Jiri Olsa
2019-11-29 15:17 ` Arnaldo Carvalho de Melo
2019-11-29 16:06 ` Arnaldo Carvalho de Melo
2019-11-29 18:03 ` Jiri Olsa
2019-11-29 18:59 ` Arnaldo Carvalho de Melo
2019-11-29 19:09 ` Jiri Olsa
2019-12-04 7:53 ` [tip: perf/urgent] perf machine: Fill map_symbol->maps in append_inlines() to fix segfault tip-bot2 for Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 05/15] perf annotate: Pass a 'map_symbol' in places receiving a pair of 'map' and 'symbol' pointers Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 06/15] perf unwind: Use 'struct map_symbol' in 'struct unwind_entry' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 07/15] perf callchain: Use 'struct map_symbol' in 'struct callchain_cursor_node' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 08/15] pref tools: Make 'struct addr_map_symbol' contain 'struct map_symbol' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 09/15] perf symbols: Use kmaps(map)->machine when we know its a kernel map Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 10/15] perf tools: Add a 'struct map_groups' pointer to 'struct map_symbol' Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 11/15] perf annotate: Stop using map->groups, use map_symbol->mg instead Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 12/15] perf map: Combine maps__fixup_overlappings with its only use Arnaldo Carvalho de Melo
2019-11-12 18:37 ` Arnaldo Carvalho de Melo [this message]
2019-11-12 18:37 ` [PATCH 14/15] perf tool: Provide an option to print perf_event_open args and return value Arnaldo Carvalho de Melo
2019-11-12 18:37 ` [PATCH 15/15] perf parse: Use YYABORT to clear stack after failure, plugging leaks Arnaldo Carvalho de Melo
2019-11-15 7:35 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191112183757.28660-14-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.