diff options
author | Joseph Huber <huberjn@outlook.com> | 2025-08-08 14:28:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-08 14:28:41 -0500 |
commit | ca006898b3c289808b05562a59ded11fedfc5406 (patch) | |
tree | a1b65912a99db57ceb5608cce3e129576e6cfa4e /lldb/scripts/Python | |
parent | 817133d7d90de9d8cae83c3d27704912f967d189 (diff) | |
download | llvm-ca006898b3c289808b05562a59ded11fedfc5406.zip llvm-ca006898b3c289808b05562a59ded11fedfc5406.tar.gz llvm-ca006898b3c289808b05562a59ded11fedfc5406.tar.bz2 |
[libc] Cache old slabs when allocating GPU memory (#151866)
Summary:
This patch introduces a lock-free stack used to store a fixed number of
slabs. Instead of going directly through RPC memory, we instead can
consult the cache and use that. Currently, this means that ~64 MiB of
memory will remain in-use if the user completely fills the cache.
However, because we always fully destroy the object, the chunk size can
be reset so they can be fully reused.
This greatly improves performance in cases where the user has previously
accessed malloc, lowering the difference between an implementation that
does not free slabs at all and one that does.
We can also skip the expensive zeroing step if the old chunk size was
smaller than the previous one. Smaller chunk sizes need a larger
bitfield, and because we know for a fact that the number of users
remaining in this slab is zero thanks to the reference counting we can
guarantee that the bitfield is all zero like when it was initialized.
Diffstat (limited to 'lldb/scripts/Python')
0 files changed, 0 insertions, 0 deletions