From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30021 invoked by alias); 21 Oct 2011 06:01:27 -0000 Received: (qmail 30002 invoked by uid 22791); 21 Oct 2011 06:01:25 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 06:01:10 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9L610fe014672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Oct 2011 02:01:00 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9L60xjB023072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Oct 2011 02:00:59 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p9L60xUZ025561; Fri, 21 Oct 2011 08:00:59 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p9L60wGu024615; Fri, 21 Oct 2011 08:00:58 +0200 Date: Fri, 21 Oct 2011 09:06:00 -0000 From: Jakub Jelinek To: Andi Kleen Cc: gcc-patches@gcc.gnu.org, Andi Kleen Subject: Re: [PATCH 3/3] Add a fragmentation fallback in ggc-page Message-ID: <20111021060057.GP2210@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <1319176370-26071-1-git-send-email-andi@firstfloor.org> <1319176370-26071-4-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1319176370-26071-4-git-send-email-andi@firstfloor.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg01932.txt.bz2 On Fri, Oct 21, 2011 at 07:52:50AM +0200, Andi Kleen wrote: > @@ -776,13 +778,18 @@ alloc_page (unsigned order) > extras on the freelist. (Can only do this optimization with > mmap for backing store.) */ > struct page_entry *e, *f = G.free_pages; > - int i; > + int i, entries; > > - page = alloc_anon (NULL, G.pagesize * GGC_QUIRE_SIZE); > + page = alloc_anon (NULL, G.pagesize * GGC_QUIRE_SIZE, false); > + if (page == NULL) > + { > + page = alloc_anon(NULL, G.pagesize, true); > + entries = 1; > + } > > /* This loop counts down so that the chain will be in ascending > memory order. */ > - for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--) > + for (i = entries - 1; i >= 1; i--) entries may be uninitialized here. Plus indentantion is wrong (missing space between alloc_anon and (, incorrect amount or kind (tab vs. spaces) of leading whitespace. Jakub