From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units Date: Fri, 30 Mar 2018 06:30:42 -0700 Message-ID: References: <20180330052241.206667-2-edumazet@google.com> <20180330052241.206667-5-edumazet@google.com> <20180330071814.GA27025@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "David S . Miller" , netdev , Florian Westphal , Thomas Graf , Jesper Dangaard Brouer , Alexander Aring , Stefan Schmidt , Eric Dumazet , Nikolay Aleksandrov To: Herbert Xu , Eric Dumazet Return-path: Received: from mail-pg0-f51.google.com ([74.125.83.51]:38598 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbeC3NbL (ORCPT ); Fri, 30 Mar 2018 09:31:11 -0400 Received: by mail-pg0-f51.google.com with SMTP id a15so5070468pgn.5 for ; Fri, 30 Mar 2018 06:31:11 -0700 (PDT) In-Reply-To: <20180330071814.GA27025@gondor.apana.org.au> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 03/30/2018 12:18 AM, Herbert Xu wrote: > Instead of using the walk interface, how about > rhashtable_free_and_destroy? Oh, I was not aware of this beast ;) I guess I will need to add a cond_resched() in it, right ? My rough guess is that freeing 30 million frags would take few seconds ;) > >> void inet_frag_kill(struct inet_frag_queue *fq) >> { >> if (del_timer(&fq->timer)) >> refcount_dec(&fq->refcnt); >> >> if (!(fq->flags & INET_FRAG_COMPLETE)) { >> - fq_unlink(fq); >> + struct netns_frags *nf = fq->net; >> + >> + fq->flags |= INET_FRAG_COMPLETE; >> + rhashtable_remove_fast(&nf->rhashtable, &fq->node, nf->f->rhash_params); >> refcount_dec(&fq->refcnt); >> } >> } > > This means that the hash won't inline properly. Don't know big > of an issue it is to you. But you could fix it by doing the same > hack as rhashtable by making inet_frag_kill an inline function and > take the rhash_params as an explicit argument. I will investigate this, thanks !