Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261862AbVAEAkz (ORCPT ); Tue, 4 Jan 2005 19:40:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262093AbVAEAgl (ORCPT ); Tue, 4 Jan 2005 19:36:41 -0500 Received: from fw.osdl.org ([65.172.181.6]:54765 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S261862AbVAEAe0 (ORCPT ); Tue, 4 Jan 2005 19:34:26 -0500 Date: Tue, 4 Jan 2005 16:34:21 -0800 (PST) From: Linus Torvalds To: Christoph Lameter cc: Andrew Morton , linux-ia64@vger.kernel.org, linux-mm@kvack.org, Linux Kernel Development Subject: Re: Prezeroing V3 [1/4]: Allow request for zeroed memory In-Reply-To: Message-ID: References: <41C20E3E.3070209@yahoo.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1469 Lines: 48 On Tue, 4 Jan 2005, Christoph Lameter wrote: > > This patch introduces __GFP_ZERO as an additional gfp_mask element to allow > to request zeroed pages from the page allocator. Ok, let's start merging this slowly, and in particular, this 1/4 one looks pretty much like a cleanup regardless of whatever else happen, so let's just do it. However, for it to really be a cleanup, how about making _this_ part: > + > + if (gfp_flags & __GFP_ZERO) { > +#ifdef CONFIG_HIGHMEM > + if (PageHighMem(page)) { > + int n = 1 << order; > + > + while (n-- >0) > + clear_highpage(page + n); > + } else > +#endif > + clear_page(page_address(page), order); > + } Match the existing previous part: > if (order && (gfp_flags & __GFP_COMP)) > prep_compound_page(page, order); and just split it up into a "prep_zero_page(page, order)"? I dislike #ifdef's in the middle of deep functions. In the middle of a _trivial_ function it's much more palatable. At that point at least part 1 ends up being a nice clean patch on its own, and should even shrink the code-size a bit. IOW, it not only is a cleanup, there is even a technical argument for it (even without worrying about the next stages). Hmm? Linus - 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/