lkml.org 
[lkml]   [2005]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Prezeroing V3 [1/4]: Allow request for zeroed memory
From
Date
On Tue, 2005-01-04 at 15:13 -0800, Christoph Lameter wrote:
> + 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);
> + }
> if (order && (gfp_flags & __GFP_COMP))
> prep_compound_page(page, order);

That #ifdef can probably die. The compiler should get that all by
itself:

> #ifdef CONFIG_HIGHMEM
> #define PageHighMem(page) test_bit(PG_highmem, &(page)->flags)
> #else
> #define PageHighMem(page) 0 /* needed to optimize away at compile time */
> #endif

-- Dave

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.143 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site