This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [v4] malloc: Consistently apply trim_threshold to all heaps [BZ #17195]
- From: Mel Gorman <mgorman at suse dot de>
- To: Julian Taylor <jtaylor dot debian at googlemail dot com>
- Cc: libc-alpha at sourceware dot org, Carlos O'Donell <carlos at redhat dot com>, Siddhesh Poyarekar <siddhesh at redhat dot com>, Rik van Riel <riel at redhat dot com>, KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, Konstantin Serebryany <kcc at google dot com>, Minchan Kim <minchan dot kim at gmail dot com>
- Date: Thu, 19 Feb 2015 10:40:22 +0000
- Subject: Re: [PATCH] [v4] malloc: Consistently apply trim_threshold to all heaps [BZ #17195]
- Authentication-results: sourceware.org; auth=none
- References: <20150218102900 dot GF23372 at suse dot de> <54E50D4D dot 7080205 at googlemail dot com>
On Wed, Feb 18, 2015 at 11:08:13PM +0100, Julian Taylor wrote:
> On 18.02.2015 11:29, Mel Gorman wrote:
>
> >
> > 2015-02-10 Mel Gorman <mgorman@suse.de>
> >
> > [BZ #17195]
> > * malloc/arena.c (free): Apply trim threshold to per-thread heaps
> > as well as the main arena.
> > ---
> > malloc/arena.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/malloc/arena.c b/malloc/arena.c
> > index 886defb074a2..a78d4835a825 100644
> > --- a/malloc/arena.c
> > +++ b/malloc/arena.c
> > @@ -696,7 +696,7 @@ heap_trim (heap_info *heap, size_t pad)
> > }
> > top_size = chunksize (top_chunk);
> > extra = (top_size - pad - MINSIZE - 1) & ~(pagesz - 1);
> > - if (extra < (long) pagesz)
> > + if (extra < (long) mp_.trim_threshold)
> > return 0;
> >
> > /* Try to shrink. */
> >
>
> the patch does not seem to account for trim threshold being -1 which is
> documented to disable the threshold.
Well spotted, will post v5 shortly that matches the style for the main
arena test to catch this case.
--
Mel Gorman
SUSE Labs