mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
inet: frags: use kmem_cache for inet_frag_queue
Use kmem_cache to allocate/free inet_frag_queue objects since they're all the same size per inet_frags user and are alloced/freed in high volumes thus making it a perfect case for kmem_cache. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2e404f632f
commit
d4ad4d22e7
6 changed files with 35 additions and 9 deletions
|
@ -55,6 +55,7 @@
|
|||
*/
|
||||
|
||||
static int sysctl_ipfrag_max_dist __read_mostly = 64;
|
||||
static const char ip_frag_cache_name[] = "ip4-frags";
|
||||
|
||||
struct ipfrag_skb_cb
|
||||
{
|
||||
|
@ -860,5 +861,7 @@ void __init ipfrag_init(void)
|
|||
ip4_frags.qsize = sizeof(struct ipq);
|
||||
ip4_frags.match = ip4_frag_match;
|
||||
ip4_frags.frag_expire = ip_expire;
|
||||
inet_frags_init(&ip4_frags);
|
||||
ip4_frags.frags_cache_name = ip_frag_cache_name;
|
||||
if (inet_frags_init(&ip4_frags))
|
||||
panic("IP: failed to allocate ip4_frags cache\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue