On Tue, 16 Jun 2015 14:38:53 +0200
Daniel Wagner <wagi@xxxxxxxxx> wrote:
*map, void *key)
if (l) {
hlist_del_rcu(&l->hash_node);
htab->count--;
- kfree_rcu(l, rcu);
+ /* kfree_rcu(l, rcu); */
So this kfree_rcu() is only being used to defer a free, and has nothing
to do with having to free 'l' from rcu?
+static int free_thread(void *arg)
+{
+ unsigned long flags;
+ struct htab_elem *l;
+
+ while (!kthread_should_stop()) {
+ spin_lock_irqsave(&elem_freelist_lock, flags);
+ while (!list_empty(&elem_freelist)) {
+ l = list_entry(elem_freelist.next,
+ struct htab_elem, list);
+ list_del(&l->list);
+ kfree(l);
+ }
+ spin_unlock_irqrestore(&elem_freelist_lock, flags);
Wow! This is burning up CPU isn't it?
If you just need to delay the kfree, why not use irq_work for that job?