From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16731 invoked by alias); 21 Oct 2011 09:42:42 -0000 Received: (qmail 16721 invoked by uid 22791); 21 Oct 2011 09:42:41 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 09:42:27 +0000 Received: by qam2 with SMTP id 2so3096151qam.20 for ; Fri, 21 Oct 2011 02:42:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.131.34 with SMTP id oj2mr931278obb.71.1319190146655; Fri, 21 Oct 2011 02:42:26 -0700 (PDT) Received: by 10.182.12.202 with HTTP; Fri, 21 Oct 2011 02:42:26 -0700 (PDT) In-Reply-To: <1319176370-26071-2-git-send-email-andi@firstfloor.org> References: <1319176370-26071-1-git-send-email-andi@firstfloor.org> <1319176370-26071-2-git-send-email-andi@firstfloor.org> Date: Fri, 21 Oct 2011 10:04:00 -0000 Message-ID: Subject: Re: [PATCH 1/3] Add missing page rounding of a page_entry From: Richard Guenther To: Andi Kleen Cc: gcc-patches@gcc.gnu.org, Andi Kleen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01944.txt.bz2 On Fri, Oct 21, 2011 at 7:52 AM, Andi Kleen wrote: > From: Andi Kleen > > 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. Ok. Thanks, RIchard. > gcc/: > > 2011-10-18 =A0Andi Kleen =A0 > > =A0 =A0 =A0 =A0* ggc-page.c (alloc_pages): Always round up entry_size. > --- > =A0gcc/ggc-page.c | =A0 =A01 + > =A01 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c > index 2da99db..ba88e3f 100644 > --- a/gcc/ggc-page.c > +++ b/gcc/ggc-page.c > @@ -736,6 +736,7 @@ alloc_page (unsigned order) > =A0 entry_size =3D num_objects * OBJECT_SIZE (order); > =A0 if (entry_size < G.pagesize) > =A0 =A0 entry_size =3D G.pagesize; > + =A0entry_size =3D ROUND_UP (entry_size, G.pagesize); > > =A0 entry =3D NULL; > =A0 page =3D NULL; > -- > 1.7.5.4 > >