netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH v3 nf-next 0/3] netfilter: x_tables: pack percpu counter allocations
Date: Sun, 4 Dec 2016 21:09:38 +0100	[thread overview]
Message-ID: <20161204200938.GA32460@salvia> (raw)
In-Reply-To: <1479822259-28786-1-git-send-email-fw@strlen.de>

On Tue, Nov 22, 2016 at 02:44:16PM +0100, Florian Westphal wrote:
> ... to speed up iptables(-restore) calls.
> 
> Especially a pattern like
> 
> for i in $(seq 1 1000) ; iptables -A FORWARD ;done
> 
> is expensive, because adding the rule doubles the percpu counters (allocate
> 		2nd blob, then free old one, including its percpu counters).
> This causes frequent expansion and shrinking of percpu memory pool.
> 
> This change batches calls to the allocator by packing multiple counters
> in 4k memory chunks.
> 
> Heavily based on suggestions from Eric Dumazet.
> 
> The only change in v3 is in patch #2 which assigned garbage on UP
> (was fixed by next patch, but better to not do it in first place).

Series applied, thanks!

      parent reply	other threads:[~2016-12-04 20:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 13:44 [PATCH v3 nf-next 0/3] netfilter: x_tables: pack percpu counter allocations Florian Westphal
2016-11-22 13:44 ` [PATCH v3 nf-next 1/3] netfilter: x_tables: pass xt_counters struct instead of packet counter Florian Westphal
2016-11-22 13:44 ` [PATCH v3 nf-next 2/3] netfilter: x_tables: pass xt_counters struct to counter allocator Florian Westphal
2016-11-22 13:44 ` [PATCH v3 nf-next 3/3] netfilter: x_tables: pack percpu counter allocations Florian Westphal
2016-12-04 20:09 ` Pablo Neira Ayuso [this message]

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=20161204200938.GA32460@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).