All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herve Eychenne <rv@wallfire.org>
To: Harald Welte <laforge@netfilter.org>,
	Netfilter Development <netfilter-devel@lists.netfilter.org>
Subject: [PATCH] Re: hashsize available through /proc was RAM and conntrack performance: first draft of the document is online
Date: Thu, 27 Nov 2003 05:14:52 +0100	[thread overview]
Message-ID: <20031127041452.GD1084@eychenne.org> (raw)
In-Reply-To: <20031126113645.GF3121@obroa-skai.de.gnumonks.org>

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

On Wed, Nov 26, 2003 at 12:36:45PM +0100, Harald Welte wrote:

> On Wed, Nov 26, 2003 at 04:42:32AM +0100, Herve Eychenne wrote:

> > > > So, it cannot be read at runtime, I suppose... It would be really nice,
> > > > though... would /proc be ok?
> > 
> > > yes. It is printed at startup via syslog, however.
> > 
> > Syslog can be enough for humans, but not for scripts...
> > I think you can add "make hashsize value available through /proc" to
> > the TODO list (whose size is unfortunately ever growing ;-)).

> i'd rather write a patch than add it to the todo list.  adding and
> removing that item from the list would be about the same amount of work,
> i guess.

I had a quick look at the existing code in ip_conntrack_core.c.

First I would have been happy to write a small patch, but I'm not really a
kernel guy and register_sysctl_table API seems _completely crappy_ to
me.

So I took the risk to ridiculize myself in public and wrote something, though,
but I'm unsure about my patch. Especially unsure about the Binary ID of
the ctl_table... I took NET_IP_CONNTRACK_MAX + 1 = 2090 because I could find
no occurence of 2090 user for sysctl in the whole kernel tree... but it
seems crappy and hazardous. Who the hell is in charge of ensuring the
unicity of each sysctl binary entry? Where's the list?

So I didn't even took time to compile the attached patch, but with the help of
gods if will hopefully work.

 Herve

-- 
 _
(°=  Hervé Eychenne
//)
v_/_ WallFire project:  http://www.wallfire.org/

[-- Attachment #2: ip_conntrack_core.c.patch --]
[-- Type: text/plain, Size: 1016 bytes --]

--- ip_conntrack_core.c.old	2003-11-27 04:59:57.000000000 +0100
+++ ip_conntrack_core.c.new	2003-11-27 05:09:30.000000000 +0100
@@ -1349,15 +1349,23 @@
     SO_ORIGINAL_DST, SO_ORIGINAL_DST+1, &getorigdst,
     0, NULL };
 
+#ifdef CONFIG_SYSCTL
+
 #define NET_IP_CONNTRACK_MAX 2089
 #define NET_IP_CONNTRACK_MAX_NAME "ip_conntrack_max"
 
-#ifdef CONFIG_SYSCTL
+#define NET_IP_CONNTRACK_HASHSIZE 2090
+#define NET_IP_CONNTRACK_HASHSIZE_NAME "ip_conntrack_hashsize"
+
 static struct ctl_table_header *ip_conntrack_sysctl_header;
 
 static ctl_table ip_conntrack_table[] = {
-	{ NET_IP_CONNTRACK_MAX, NET_IP_CONNTRACK_MAX_NAME, &ip_conntrack_max,
-	  sizeof(ip_conntrack_max), 0644,  NULL, proc_dointvec },
+	{ NET_IP_CONNTRACK_MAX, NET_IP_CONNTRACK_MAX_NAME,
+	  &ip_conntrack_max, sizeof(ip_conntrack_max), 0644,
+	  NULL, proc_dointvec },
+	{ NET_IP_CONNTRACK_HASHSIZE, NET_IP_CONNTRACK_HASHSIZE_NAME,
+	  &ip_conntrack_htable_size, sizeof(ip_conntrack_htable_size), 0444,
+	  NULL, proc_dointvec },
  	{ 0 }
 };
 

  parent reply	other threads:[~2003-11-27  4:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28 15:10 RAM and conntrack performance Herve Eychenne
2003-11-03  8:12 ` Harald Welte
2003-11-25 15:35   ` Herve Eychenne
2003-11-25 20:57     ` Harald Welte
2003-11-26  3:42       ` RAM and conntrack performance: first draft of the document is online Herve Eychenne
2003-11-26  4:13         ` Henrik Nordstrom
2003-11-27  4:56           ` Herve Eychenne
2003-11-28 11:00             ` Willy Tarreau
2003-11-26 11:36         ` Harald Welte
2003-11-26 16:26           ` Patrick McHardy
2003-11-27 11:10             ` Harald Welte
2003-11-27  3:33           ` Herve Eychenne
2003-11-27  9:56             ` Henrik Nordstrom
2003-11-30 22:25             ` Harald Welte
2003-11-27  4:14           ` Herve Eychenne [this message]
2003-11-27 10:09             ` [PATCH] Re: hashsize available through /proc was " Henrik Nordstrom
2003-11-27 10:13               ` Henrik Nordstrom
2003-11-27 11:38               ` Herve Eychenne
2003-11-27 11:57                 ` Henrik Nordstrom
2003-11-27 11:14             ` Harald Welte

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=20031127041452.GD1084@eychenne.org \
    --to=rv@wallfire.org \
    --cc=laforge@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.