From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756459AbbFPRMH (ORCPT ); Tue, 16 Jun 2015 13:12:07 -0400 Received: from mail-wg0-f54.google.com ([74.125.82.54]:34924 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754403AbbFPRL6 (ORCPT ); Tue, 16 Jun 2015 13:11:58 -0400 Message-ID: <558058D9.5090700@monom.org> Date: Tue, 16 Jun 2015 19:11:53 +0200 From: Daniel Wagner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Steven Rostedt CC: paulmck@linux.vnet.ibm.com, Alexei Starovoitov , Daniel Wagner , LKML Subject: Re: call_rcu from trace_preempt References: <557F509D.2000509@plumgrid.com> <20150615230702.GB3913@linux.vnet.ibm.com> <557F7764.5060707@plumgrid.com> <20150616021458.GE3913@linux.vnet.ibm.com> <557FB7E1.6080004@plumgrid.com> <20150616122733.GG3913@linux.vnet.ibm.com> <558018DD.1080701@monom.org> <20150616114151.3681a9e8@gandalf.local.home> In-Reply-To: <20150616114151.3681a9e8@gandalf.local.home> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/16/2015 05:41 PM, Steven Rostedt wrote: > On Tue, 16 Jun 2015 14:38:53 +0200 > Daniel Wagner 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