Bug 1764218 - glibc: Backport malloc fastbin (mxfast) enhancements
Summary: glibc: Backport malloc fastbin (mxfast) enhancements
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.2
Assignee: Arjun Shankar
QA Contact: qe-baseos-tools-bugs
Oss Tikhomirova
URL:
Whiteboard:
Depends On:
Blocks: 1746918
TreeView+ depends on / blocked
 
Reported: 2019-10-22 13:36 UTC by Florian Weimer
Modified: 2020-04-28 16:50 UTC (History)
8 users (show)

Fixed In Version: glibc-2.28-81.el8
Doc Type: Enhancement
Doc Text:
.A new tunable for changing the maximum fastbin size in `glibc` The `malloc` function uses a series of fastbins that hold reusable memory chunks up to a specific size. The default maximum chunk size is 80 bytes on 32-bit systems and 160 bytes on 64-bit systems. This enhancement introduces a new `glibc.malloc.mxfast` tunable to `glibc` that enables you to change the maximum fastbin size.
Clone Of:
Environment:
Last Closed: 2020-04-28 16:50:19 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1828 None None None 2020-04-28 16:50:46 UTC
Sourceware 24903 P3 RESOLVED malloc/tst-mxfast fails on i386 2020-05-04 15:44:01 UTC

Description Florian Weimer 2019-10-22 13:36:29 UTC
We should backport the following enhancements:

commit c48d92b430c480de06762f80c104922239416826
Author: DJ Delorie <dj@redhat.com>
Date:   Thu Aug 8 19:09:43 2019 -0400

    Add glibc.malloc.mxfast tunable
    
    * elf/dl-tunables.list: Add glibc.malloc.mxfast.
    * manual/tunables.texi: Document it.
    * malloc/malloc.c (do_set_mxfast): New.
    (__libc_mallopt): Call it.
    * malloc/arena.c: Add mxfast tunable.
    * malloc/tst-mxfast.c: New.
    * malloc/Makefile: Add it.
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

commit f9769a239784772453d595bc2f4bed8739810e06
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Aug 15 11:37:18 2019 +0200

    malloc: Various cleanups for malloc/tst-mxfast

We also need to fix the upstream bug, <https://sourceware.org/bugzilla/show_bug.cgi?id=24903>, or at least XFAIL the test (upstream and downstream).  Currently, malloc/tst-mxfast fails on i686.

Comment 1 Florian Weimer 2019-10-22 13:41:53 UTC
These commits also need to be backported in Fedora (30 and later at least).

Comment 2 Arjun Shankar 2019-10-31 18:36:11 UTC
This additional commit was needed in order to fix a bug in set_max_fast
that caused a testsuite failure on i386:

commit ff12e0fb91b9072800f031cb21fb2651ee7b6251
Author: DJ Delorie <dj@redhat.com>
Date:   Wed Oct 30 18:03:14 2019 -0400

    Base max_fast on alignment, not width, of bins (Bug 24903)
    
    set_max_fast sets the "impossibly small" value based on,
    eventually, MALLOC_ALIGNMENT.  The comparisons for the smallest
    chunk used is, eventually, MIN_CHUNK_SIZE.  Note that i386
    is the only platform where these are the same, so a smallest
    chunk *would* be put in a no-fastbins fastbin.
    
    This change calculates the "impossibly small" value
    based on MIN_CHUNK_SIZE instead, so that we can know it will
    always be impossibly small.

Comment 4 Sergey Kolosov 2020-03-16 19:00:51 UTC
Verified with malloc/tst-mxfast

Comment 11 errata-xmlrpc 2020-04-28 16:50:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1828


Note You need to log in before you can comment on or make changes to this bug.