Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758104Ab3GMDI5 (ORCPT ); Fri, 12 Jul 2013 23:08:57 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:59030 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758078Ab3GMDI4 (ORCPT ); Fri, 12 Jul 2013 23:08:56 -0400 MIME-Version: 1.0 In-Reply-To: <20130712074558.GP18798@sgi.com> References: <1373594635-131067-1-git-send-email-holt@sgi.com> <1373594635-131067-3-git-send-email-holt@sgi.com> <20130712074558.GP18798@sgi.com> Date: Fri, 12 Jul 2013 20:08:56 -0700 X-Google-Sender-Auth: PxdDMSeY6XHJZt9t1MfZIWiVD4A Message-ID: Subject: Re: [RFC 2/4] Have __free_pages_memory() free in larger chunks. From: Yinghai Lu To: Robin Holt Cc: "H. Peter Anvin" , Ingo Molnar , Nate Zimmer , Linux Kernel , Linux MM , Rob Landley , Mike Travis , Daniel J Blueman , Andrew Morton , Greg KH , Mel Gorman Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 813 Lines: 27 On Fri, Jul 12, 2013 at 12:45 AM, Robin Holt wrote: > At the very least, I think we could change to: > static void __init __free_pages_memory(unsigned long start, unsigned long end) > { > int order; > > while (start < end) { > order = ffs(start); > > while (start + (1UL << order) > end) > order--; > > __free_pages_bootmem(start, order); > > start += (1UL << order); > } > } should work, but need to make sure order < MAX_ORDER. Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/