lkml.org 
[lkml]   [2004]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Prezeroing V2 [1/4]: __GFP_ZERO / clear_page() removal
Christoph Lameter wrote:
> This patch introduces __GFP_ZERO as an additional gfp_mask element to allow
> to request zeroed pages from the page allocator.
>
> o Modifies the page allocator so that it zeroes memory if __GFP_ZERO is set
>
> o Replace all page zeroing after allocating pages by request for
> zeroed pages.
>
> o requires arch updates to clear_page in order to function properly.
>
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
>

> @@ -125,22 +125,19 @@
> int i;
> struct packet_data *pkt;
>
> - pkt = kmalloc(sizeof(struct packet_data), GFP_KERNEL);
> + pkt = kmalloc(sizeof(struct packet_data), GFP_KERNEL|__GFP_ZERO);
> if (!pkt)
> goto no_pkt;
> - memset(pkt, 0, sizeof(struct packet_data));
>
> pkt->w_bio = pkt_bio_alloc(PACKET_MAX_SIZE);
> if (!pkt->w_bio)

This part is wrong. kmalloc() uses the slab allocator instead of
getting a full page.

--
Brian Gerst
-
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.188 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site