[PATCH 1/3] Add missing page rounding of a page_entry
Fri Oct 21 18:08:00 GMT 2011
On Fri, Oct 21, 2011 at 11:52:44AM +0200, Jakub Jelinek wrote:
> On Fri, Oct 21, 2011 at 11:42:26AM +0200, Richard Guenther wrote:
> > On Fri, Oct 21, 2011 at 7:52 AM, Andi Kleen <firstname.lastname@example.org> wrote:
> > > From: Andi Kleen <email@example.com>
> > >
> > > This one place in ggc forgot to round page_entry->bytes to the
> > > next page boundary, which lead to all the heuristics in freeing to
> > > check for continuous memory failing. Round here too, like all other
> > > allocators already do. The memory consumed should be the same
> > > for MMAP because the kernel would round anyways. It may slightly
> > > increase memory usage when malloc groups are used.
> > >
> > > This will also increase the hitrate on the free page list
> > > slightly.
> > > 2011-10-18 Â Andi Kleen Â <firstname.lastname@example.org>
> > >
> > > Â Â Â Â * ggc-page.c (alloc_pages): Always round up entry_size.
> As I said in the PR, ROUND_UP should make the previous
> if (entry_size < G.pagesize)
> entry_size = G.pagesize;
> completely unnecessary.
AFAIK there are objects > pagesize in GGC, but not too many
But you're right it will be somewhat expensive (although the mmap
is not very common anyways and most other allocations
already do the roundup). I can drop it.
More information about the Gcc-patches