Re: call_rcu from trace_preempt

From: Daniel Wagner
Date: Tue Jun 16 2015 - 13:12:11 EST


On 06/16/2015 05:41 PM, Steven Rostedt wrote:
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?

Not 100% sure but I got the impression kfree_rcu only defers the free.

+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?

Sure, this is a very busy thread :) I was just experimenting if defering it to a thread would paper of the problem.

If you just need to delay the kfree, why not use irq_work for that job?

Good point. I tried that tomorrow.

cheers,
daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/