Skip to content

Commit

Permalink
fib_trie: no need to delay vfree()
Browse files Browse the repository at this point in the history
Now that vfree() can be called from interrupt contexts, there's no
need to play games with schedule_work() to escape calling vfree()
from RCU callbacks.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Al Viro authored and David S. Miller committed May 6, 2013
1 parent b56141a commit 0020356
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ struct tnode {
unsigned int empty_children; /* KEYLENGTH bits needed */
union {
struct rcu_head rcu;
struct work_struct work;
struct tnode *tnode_free;
};
struct rt_trie_node __rcu *child[0];
Expand Down Expand Up @@ -383,12 +382,6 @@ static struct tnode *tnode_alloc(size_t size)
return vzalloc(size);
}

static void __tnode_vfree(struct work_struct *arg)
{
struct tnode *tn = container_of(arg, struct tnode, work);
vfree(tn);
}

static void __tnode_free_rcu(struct rcu_head *head)
{
struct tnode *tn = container_of(head, struct tnode, rcu);
Expand All @@ -397,10 +390,8 @@ static void __tnode_free_rcu(struct rcu_head *head)

if (size <= PAGE_SIZE)
kfree(tn);
else {
INIT_WORK(&tn->work, __tnode_vfree);
schedule_work(&tn->work);
}
else
vfree(tn);
}

static inline void tnode_free(struct tnode *tn)
Expand Down

0 comments on commit 0020356

Please sign in to comment.