This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [v4] malloc: Consistently apply trim_threshold to all heaps [BZ #17195]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]