Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>, Florian Westphal <fw@strlen.de>,
	Thomas Graf <tgraf@suug.ch>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@osg.samsung.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Nikolay Aleksandrov <nikolay@redhat.com>
Subject: Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units
Date: Fri, 30 Mar 2018 06:30:42 -0700	[thread overview]
Message-ID: <bc46ffdc-e3c4-93be-39ab-76c2634f2c6e@gmail.com> (raw)
In-Reply-To: <20180330071814.GA27025@gondor.apana.org.au>



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 !

  reply	other threads:[~2018-03-30 13:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30  5:22 [PATCH net-next 1/6] ipv6: frag: remove unused field Eric Dumazet
2018-03-30  5:22 ` [PATCH net-next 2/6] inet: frags: change inet_frags_init_net() return value Eric Dumazet
2018-03-30  5:22 ` [PATCH net-next 3/6] inet: frags: add a pointer to struct netns_frags Eric Dumazet
2018-03-30  5:22 ` [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units Eric Dumazet
2018-03-30  7:18   ` Herbert Xu
2018-03-30 13:30     ` Eric Dumazet [this message]
2018-03-30 16:37       ` Herbert Xu
2018-03-30 11:44   ` Kirill Tkhai
2018-03-30 16:09     ` Eric Dumazet
2018-03-30  5:22 ` [PATCH net-next 5/6] inet: frags: remove some helpers Eric Dumazet
2018-03-30  5:22 ` [PATCH net-next 6/6] inet: frags: break the 2GB limit for frags storage Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc46ffdc-e3c4-93be-39ab-76c2634f2c6e@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=alex.aring@gmail.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    --cc=stefan@osg.samsung.com \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox