Subject: Re: [net-next-2.6 PATCH 1/5] ixgbe: Allocate driver resources per NUMA node

From: Andi Kleen <[email-masked]>
Date: Thu, 14 Jan 2010 12:02:06 +0100

Jeff Kirsher <[email-masked]> writes:
>  enum ixbge_state_t {
> diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
> index 2ad754c..6895de7 100644
> --- a/drivers/net/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ixgbe/ixgbe_main.c
> @@ -3741,7 +3741,8 @@ static int ixgbe_alloc_q_vectors(struct ixgbe_adapter *adapter)
>  	}
>  
>  	for (q_idx = 0; q_idx < num_q_vectors; q_idx++) {
> -		q_vector = kzalloc(sizeof(struct ixgbe_q_vector), GFP_KERNEL);
> +		q_vector = kzalloc_node(sizeof(struct ixgbe_q_vector),
> +		                        GFP_KERNEL, adapter->node);

The problem of doing this is that the node might be full or have
no memory and k*alloc_node will fail then.

So you would need a fallback to be reliable (we probably should have a
generic utility function for this somewhere, but we don't currently)

-Andi

-- 
[email-masked] -- Speaking for myself only.