]> git.baikalelectronics.ru Git - kernel.git/commit
IPV4: fib_trie use vmalloc for large tnodes
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 10 Apr 2008 09:56:38 +0000 (02:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Apr 2008 09:56:38 +0000 (02:56 -0700)
commitf54e1e31b72654d47e22f47f218c8cbb60fb1659
tree83fc9261da859ecf3d6dcad29dadc78f481f7d7f
parent7e4bf921d0e3a6ca56d265a74bf2d9f144c73e4e
IPV4: fib_trie use vmalloc for large tnodes

Use vmalloc rather than alloc_pages to avoid wasting memory.
The problem is that tnode structure has a power of 2 sized array,
plus a header. So the current code wastes almost half the memory
allocated because it always needs the next bigger size to hold
that small header.

This is similar to an earlier patch by Eric, but instead of a list
and lock, I used a workqueue to handle the fact that vfree can't
be done in interrupt context.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c