Re: [PATCH v3 nf-next 2/2] netfilter: xtables: avoid percpu ruleset duplication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2015-06-12 at 14:32 +0200, Pablo Neira Ayuso wrote:
> On Wed, Jun 10, 2015 at 10:32:53PM -0700, Eric Dumazet wrote:
> > On Thu, 2015-06-11 at 01:34 +0200, Florian Westphal wrote:
> > > We store the rule blob per (possible) cpu.  Unfortunately this means we can
> > > waste lot of memory on big smp machines. ipt_entry structure ('rule head')
> > > is 112 byte, so e.g. with maxcpu=64 one single rule eats
> > > close to 8k RAM.
> > > 
> > > Since previous patch made counters percpu it appears there is nothing
> > > left in the rule blob that needs to be percpu.
> > > 
> > > On my test system (144 possible cpus, 400k dummy rules) this
> > > change saves close to 9 Gigabyte of RAM.
> > > 
> > > Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>
> > > Acked-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
> > > Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
> > > ---
> > 
> > Very happy to see this happening, thanks Florian.
> > 
> > Acked-by: Eric Dumazet <edumazet@xxxxxxxxxx>
> 
> Applied this series, thanks !

Note that now we have a single copy of the rules, we might try to use
kmalloc() instead of vmalloc() a bit harder for tables <= 64KB, reducing
TLB pressure.

newinfo->entries = NULL;
if (size <= PAGE_SIZE << MAX_ORDER)
	newinfo->entries = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
if (!newinfo->entries)
	newinfo->entries = vmalloc(size);


I'll send a patch for this, but can you push your tree ?
(Assuming this is
http://git.kernel.org/cgit/linux/kernel/git/pablo/nf-next.git/ )

Thanks


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux