2008-06-02 05:55:28

by Greg Banks

[permalink] [raw]
Subject: Re: [PATCH 0/3] [RFC] knfsd: convert to kthread API and remove signaling for shutdown

Jeff Layton wrote:
>
> I started to do this patch as part of the kthread conversion, but it's
> actually pretty independent. We can probably treat it separately.
> This hasn't been tested on an actual NUMA machine yet, but any thoughts
> on the following patch?
> [...]
>
> - rqstp = kzalloc(sizeof(*rqstp), GFP_KERNEL);
> + rqstp = kmalloc_node(sizeof(*rqstp), GFP_KERNEL | __GFP_ZERO, node);
> if (!rqstp)
> goto out_enomem;
>
I'm not an expert, but from looking at the slab code I don't think
__GFP_ZERO works the way you're expecting on the kmalloc() family, only
on the alloc_pages() family. In particular it's not used when the
object is allocated on the slab fastpath. kzalloc() seems to be a
kmalloc() followed by a memset(). Perhaps you'd be better off either
adding a kzalloc_node() or doing kmalloc_node() plus memset().

Apart from that and Bruce's comment the patch looks like it would work.

--
Greg Banks, P.Engineer, SGI Australian Software Group.
The cake is *not* a lie.
I don't speak for SGI.