diff options
| author | Florian Weimer <fweimer@redhat.com> | 2023-08-10 19:36:56 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2023-08-15 08:07:36 +0200 |
| commit | 0dc7fc1cf094406a138e4d1bcf9553e59edcf89d (patch) | |
| tree | c74a61aeb2904253a0903aefc8f562cb00ec80f0 /malloc/tst-memalign-2.c | |
| parent | 648b832600e94c09e3cee2fa6d3c3684687505e4 (diff) | |
| download | glibc-0dc7fc1cf094406a138e4d1bcf9553e59edcf89d.tar.xz glibc-0dc7fc1cf094406a138e4d1bcf9553e59edcf89d.zip | |
malloc: Remove bin scanning from memalign (bug 30723)
On the test workload (mpv --cache=yes with VP9 video decoding), the
bin scanning has a very poor success rate (less than 2%). The tcache
scanning has about 50% success rate, so keep that.
Update comments in malloc/tst-memalign-2 to indicate the purpose
of the tests. Even with the scanning removed, the additional
merging opportunities since commit 542b1105852568c3ebc712225ae78b
("malloc: Enable merging of remainders in memalign (bug 30723)")
are sufficient to pass the existing large bins test.
Remove leftover variables from _int_free from refactoring in the
same commit.
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc/tst-memalign-2.c')
| -rw-r--r-- | malloc/tst-memalign-2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/malloc/tst-memalign-2.c b/malloc/tst-memalign-2.c index f229283dbf..ecd6fa249e 100644 --- a/malloc/tst-memalign-2.c +++ b/malloc/tst-memalign-2.c @@ -86,7 +86,8 @@ do_test (void) TEST_VERIFY (tcache_allocs[i].ptr1 == tcache_allocs[i].ptr2); } - /* Test for non-head tcache hits. */ + /* Test for non-head tcache hits. This exercises the memalign + scanning code to find matching allocations. */ for (i = 0; i < array_length (ptr); ++ i) { if (i == 4) @@ -113,7 +114,9 @@ do_test (void) free (p); TEST_VERIFY (count > 0); - /* Large bins test. */ + /* Large bins test. This verifies that the over-allocated parts + that memalign releases for future allocations can be reused by + memalign itself at least in some cases. */ for (i = 0; i < LN; ++ i) { |
