[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <558058D9.5090700@monom.org>
Date: Tue, 16 Jun 2015 19:11:53 +0200
From: Daniel Wagner <wagi@...om.org>
To: Steven Rostedt <rostedt@...dmis.org>
CC: paulmck@...ux.vnet.ibm.com, Alexei Starovoitov <ast@...mgrid.com>,
Daniel Wagner <daniel.wagner@...-carit.de>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: call_rcu from trace_preempt
On 06/16/2015 05:41 PM, Steven Rostedt wrote:
> On Tue, 16 Jun 2015 14:38:53 +0200
> Daniel Wagner <wagi@...om.org> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists