netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: make struct napi_alloc_cache::skb_count unsigned int
@ 2016-11-19  0:47 Alexey Dobriyan
  2016-11-20  3:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2016-11-19  0:47 UTC (permalink / raw)
  To: davem; +Cc: netdev

size_t is way too much for an integer not exceeding 64.

Space savings: 10 bytes!

	add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-10 (-10)
	function                                     old     new   delta
	napi_consume_skb                             165     163      -2
	__kfree_skb_flush                             56      53      -3
	__kfree_skb_defer                             97      92      -5
	Total: Before=154865639, After=154865629, chg -0.00%

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 net/core/skbuff.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -354,7 +354,7 @@ EXPORT_SYMBOL(build_skb);
 
 struct napi_alloc_cache {
 	struct page_frag_cache page;
-	size_t skb_count;
+	unsigned int skb_count;
 	void *skb_cache[NAPI_SKB_CACHE_SIZE];
 };
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: make struct napi_alloc_cache::skb_count unsigned int
  2016-11-19  0:47 [PATCH] net: make struct napi_alloc_cache::skb_count unsigned int Alexey Dobriyan
@ 2016-11-20  3:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-11-20  3:11 UTC (permalink / raw)
  To: adobriyan; +Cc: netdev

From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Sat, 19 Nov 2016 03:47:56 +0300

> size_t is way too much for an integer not exceeding 64.
> 
> Space savings: 10 bytes!
> 
> 	add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-10 (-10)
> 	function                                     old     new   delta
> 	napi_consume_skb                             165     163      -2
> 	__kfree_skb_flush                             56      53      -3
> 	__kfree_skb_defer                             97      92      -5
> 	Total: Before=154865639, After=154865629, chg -0.00%
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-20  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-19  0:47 [PATCH] net: make struct napi_alloc_cache::skb_count unsigned int Alexey Dobriyan
2016-11-20  3:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).