Use better value for nlbufsiz
Subsystems (2)
Hi,
attached you will find a patch for a bug in ULOG which appeard during our latest performance tests.
Please apply.
Thanks. /holger
PATCH 1/1 ULOG] Use better value for 'nlbufsiz'
Performance tests showed that ULOG may fail on heavy loaded systems because of failed order-N allocations (N >= 1).
The default value of 4096 is not optimal in the sense that it actually allocates _two_ contigous physical pages. Reasoning: ULOG uses alloc_skb(), which adds another ~300 bytes for skb_shared_info.
This patch sets the default value to 3700 and adds some documentation at the top.
---
net/ipv4/netfilter/ipt_ULOG.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
4109f782faca0719825e39633d71b5e8b5dc74df
net/ipv4/netfilter/ipt_ULOG.c +6 -1
@@ -35,6 +35,11 @@* each nlgroup you are using, so the total kernel memory usage increases * by that factor. * +* Actually you should use nlbufsiz a bit smaller than PAGE_SIZE, since +* nlbufsiz is used with alloc_skb, which adds another +* sizeof(struct skb_shared_info). This is ~300 bytes on i386, so use a +* value of ~3700 instead. +* * flushtimeout: * Specify, after how many hundredths of a second the queue should be * flushed even if it is not full yet.
@@ -76,7 +81,7 @@ MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NE #define PRINTR(format, args...) do { if (net_ratelimit()) printk(format , ## args); } while (0) -static unsigned int nlbufsiz =4096 ; +static unsigned int nlbufsiz =3700 ;module_param (nlbufsiz, uint,0400 );MODULE_PARM_DESC (nlbufsiz,"netlink buffer size" );
Signature · 1 line
1.0.GIT
Re: [PATCH] ULOG] Use better value for 'nlbufsiz'
Quoted 9 lines · Holger Eitzenberger
Performance tests showed that ULOG may fail on heavy loaded systems because of failed order-N allocations (N >= 1).
The default value of 4096 is not optimal in the sense that it actually allocates _two_ contigous physical pages. Reasoning: ULOG uses
alloc_skb(), which adds another ~300 bytes forskb_shared_info.This patch sets the default value to 3700 and adds some documentation at the top.
I think we should just use NLMSG_GOODSIZE, which will use the maximum amount to fit one page on any architecture.
Re: [PATCH] ULOG] Use better value for 'nlbufsiz'
Quoted 5 lines · Patrick McHardy
Quoted 2 lines
This patch sets the default value to 3700 and adds some documentation at the top.
I think we should just use
NLMSG_GOODSIZE, which will use the maximum amount to fit one page on any architecture.
This sounds reasonable. I will resend.
/holger