linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: PATCH: kmalloc packet slab
@ 2004-12-27 17:42 Manfred Spraul
  2004-12-28  5:59 ` Dave Jones
  0 siblings, 1 reply; 10+ messages in thread
From: Manfred Spraul @ 2004-12-27 17:42 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Alan Cox, Linux Kernel Mailing List

>
>
>Why 1620 bytes ?
>
Because then 5 objects will fit into one 8 kB memory block:
5*1620+slab control structure.

> Most drivers allocate packet_size + 2 bytes.
>dev_alloc_skb adds another 16 bytes, finally alloc_skb adds
>sizeof(struct skb_shared_info). 
>
>  
>
>(32bit): 1514b + 2b + 16b + 160b = 1692b
>(64bit): 1514b + 2b + 16b + 312b = 1844b
>
>  
>
Hmm. If the shared_info is that large then the patch won't help much.

Alan - what is printed in the /proc/slabinfo line for the new cache?
- 1620 bytes is probably a bit too much for archs with 128 byte cache 
lines and 8 kB pages. If I've calculated correctly, only 4 will fit into 
one page.
- if the shared info is really that large - is the patch actually useful?

--
    Manfred


^ permalink raw reply	[flat|nested] 10+ messages in thread
* PATCH: kmalloc packet slab
@ 2004-12-27 14:16 Alan Cox
  2004-12-27 17:17 ` Patrick McHardy
  2004-12-30 18:00 ` Andi Kleen
  0 siblings, 2 replies; 10+ messages in thread
From: Alan Cox @ 2004-12-27 14:16 UTC (permalink / raw)
  To: torvalds, Linux Kernel Mailing List

The networking world runs in 1514 byte packets pretty much all the time.
This adds a 1620 byte slab for such objects and is one of the internally
generated Red Hat patches we use on things like Fedora Core 3. Original:
Arjan van de Ven.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.10/include/linux/kmalloc_sizes.h linux-2.6.10/include/linux/kmalloc_sizes.h
--- linux.vanilla-2.6.10/include/linux/kmalloc_sizes.h	2004-12-25 21:13:57.000000000 +0000
+++ linux-2.6.10/include/linux/kmalloc_sizes.h	2004-12-26 17:05:55.015102744 +0000
@@ -12,6 +12,7 @@
 	CACHE(256)
 	CACHE(512)
 	CACHE(1024)
+	CACHE(1620)
 	CACHE(2048)
 	CACHE(4096)
 	CACHE(8192)


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

end of thread, other threads:[~2004-12-30 18:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-27 17:42 PATCH: kmalloc packet slab Manfred Spraul
2004-12-28  5:59 ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2004-12-27 14:16 Alan Cox
2004-12-27 17:17 ` Patrick McHardy
2004-12-27 22:23   ` David S. Miller
2004-12-27 22:50     ` Valdis.Kletnieks
2004-12-27 22:58       ` David S. Miller
2004-12-28  0:51     ` Alan Cox
2004-12-28  6:01       ` Dave Jones
2004-12-30 18:00 ` Andi Kleen

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).