Re: [PATCH 10/17] netvm: Allow skb allocation to use PFMEMALLOC reserves

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mel Gorman <mgorman@xxxxxxx>
Date: Thu, 10 May 2012 14:45:03 +0100

> +/* Returns true if the gfp_mask allows use of ALLOC_NO_WATERMARK */
> +bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);

I know this gets added in an earlier patch, but it seems slightly
overkill to have a function call just for a simply bit test.

> +extern atomic_t memalloc_socks;
> +static inline int sk_memalloc_socks(void)
> +{
> +	return atomic_read(&memalloc_socks);
> +}

Please change this to be a static branch.

> +	skb = __alloc_skb(length + NET_SKB_PAD, gfp_mask,
> +						SKB_ALLOC_RX, NUMA_NO_NODE);

Please fix the argument indentation.

> +	data = kmalloc_reserve(size + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
> +		       gfp_mask, NUMA_NO_NODE, NULL);

Likewise.

> -	struct sk_buff *n = alloc_skb(newheadroom + skb->len + newtailroom,
> -				      gfp_mask);
> +	struct sk_buff *n = __alloc_skb(newheadroom + skb->len + newtailroom,
> +				      gfp_mask, skb_alloc_rx_flag(skb),
> +				      NUMA_NO_NODE);

Likewise.

> -			nskb = alloc_skb(hsize + doffset + headroom,
> -					 GFP_ATOMIC);
> +			nskb = __alloc_skb(hsize + doffset + headroom,
> +					 GFP_ATOMIC, skb_alloc_rx_flag(skb),
> +					 NUMA_NO_NODE);

Likewise.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]