public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/6] malloc: more memory tagging optimizations
@ 2021-03-19 13:25 Szabolcs Nagy
  2021-03-19 13:26 ` [PATCH 1/6] malloc: Use memsize instead of CHUNK_AVAILABLE_SIZE Szabolcs Nagy
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Szabolcs Nagy @ 2021-03-19 13:25 UTC (permalink / raw)
  To: libc-alpha, DJ Delorie

Second set of refactoring patches on top of the previously posted
patches. The two sets together are in the nsz/mtag-2 branch.

The main changes are renaming CHUNK_AVAILABLE_SIZE and changing
chunk2mem to not get the tag at mem (so the returned pointer
is not suitable for dereference if mem is already tagged, but
that turns out to be rare).

Further changes considered but rejected:

- remove tag_at from mem2chunk too (mem is often known to be
  untagged, or we can assume the internal tag is 0 and turn
  tag_at into an unmask operations). this does not seem to have
  much performance effect on small allocations.

- don't try to use a new tag different from the old one in
  tag_new_usable since at most call sites the old one is just
  the internal one which is excluded already from tag generation,
  only realloc benefits from the current behaviour. this change
  would be a bit aarch64 specific (tag generation can exclude the
  internally used tag) and does not have much perf effect either.

Szabolcs Nagy (6):
  malloc: Use memsize instead of CHUNK_AVAILABLE_SIZE
  malloc: Use different tag after mremap
  malloc: Use chunk2rawmem throughout
  malloc: Rename chunk2rawmem
  malloc: Remove unnecessary tagging around _mid_memalign
  malloc: Ensure mtag code path in checked_request2size is cold

 malloc/hooks.c  |  13 +++--
 malloc/malloc.c | 126 +++++++++++++++++++++++++-----------------------
 2 files changed, 72 insertions(+), 67 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-23 20:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 13:25 [PATCH 0/6] malloc: more memory tagging optimizations Szabolcs Nagy
2021-03-19 13:26 ` [PATCH 1/6] malloc: Use memsize instead of CHUNK_AVAILABLE_SIZE Szabolcs Nagy
2021-03-23 20:01   ` DJ Delorie
2021-03-19 13:26 ` [PATCH 2/6] malloc: Use different tag after mremap Szabolcs Nagy
2021-03-23 20:03   ` DJ Delorie
2021-03-19 13:26 ` [PATCH 3/6] malloc: Use chunk2rawmem throughout Szabolcs Nagy
2021-03-23 20:25   ` DJ Delorie
2021-03-19 13:27 ` [PATCH 4/6] malloc: Rename chunk2rawmem Szabolcs Nagy
2021-03-23 20:43   ` DJ Delorie
2021-03-19 13:27 ` [PATCH 5/6] malloc: Remove unnecessary tagging around _mid_memalign Szabolcs Nagy
2021-03-23 20:44   ` DJ Delorie
2021-03-19 13:27 ` [PATCH 6/6] malloc: Ensure mtag code path in checked_request2size is cold Szabolcs Nagy
2021-03-23 20:46   ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).