From: Andries Brouwer <Andries.Brouwer@cwi.nl>
To: Harald Welte <laforge@netfilter.org>
Cc: Andries Brouwer <aebr@win.tue.nl>,
Patrick McHardy <kaber@trash.net>,
akpm@osdl.org, torvalds@osdl.org,
Andries Brouwer <Andries.Brouwer@cwi.nl>,
coreteam@netfilter.org, linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [netfilter-core] [PATCH] no __initdata in netfilter?
Date: Tue, 14 Dec 2004 19:39:11 +0100 [thread overview]
Message-ID: <20041214183911.GA15606@apps.cwi.nl> (raw)
In-Reply-To: <20041214130041.GU22577@sunbeam.de.gnumonks.org>
On Tue, Dec 14, 2004 at 02:00:41PM +0100, Harald Welte wrote:
> > This is not to say that there is a bug here, that the .init
> > data would actually be referenced by non-init stuff, but
> > it is better to convince oneself by static inspection of
> > the binary than by reasoning about the flow of the program.
> >
> > Where the memory savings are important, the code should
> > be rewritten a bit.
>
> We just had a discussion, and the netfilter core team really disagrees
> with this change, which apparently was merged in
> http://linux.bkbits.net:8080/linux-2.5/cset@1.2055.4.50
>
> I think it's not a good idea to waste memory by removing __initdata,
> just to make it more convenient for some static inspection tools. This
> is just the wrong way around.
>
> If we _know_ that it works, and there is no bug, we could just add a
> comment "This is handled correctly, since the ip_tables core copies the
> data just as rulesets comming from userspace."
I think that argument is valid only when satisfying the static tool
is especially cumbersome or inefficient, requires ugly code, etc.
In most cases a trivial rewrite will suffice, and the result is cleaner
code, easier to maintain, fewer bugs.
You say "but today nothing is wrong". But the longer the reasoning is,
the easier one of the steps in the argument will be broken by some
trivial change. By someone who did not know about all the invariants
required by a certain piece of code.
Look
-rw-r--r-- 1 aeb aeb 26693922 Dec 3 22:33 patch-2.6.10-rc3
26 megabytes of changes. In a hundred trivial changes there is at least
one flaw. These 26 megabytes will again introduce lots of minor problems.
The more of these can be found automatically, by static analysis, the
more time is left for debugging serious stuff.
> Pleaes pull out that change again and submit one that adds a comment,
Not me.
> or alternatively pick up the (incremental) change attached to this mail.
> I hope this makes your checker not spit any warnings.
I checked, and indeed, no warnings for this patch.
But that is the only thing I checked. I would never submit it.
Probably you should send it to davem and see whether he likes it.
Andries
next prev parent reply other threads:[~2004-12-14 18:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-14 1:37 [PATCH] no __initdata in netfilter? Andries Brouwer
2004-11-14 7:56 ` [netfilter-core] " Patrick McHardy
2004-11-14 11:26 ` Andries Brouwer
2004-12-14 13:00 ` Harald Welte
2004-12-14 15:52 ` Linus Torvalds
2004-12-14 18:39 ` Andries Brouwer [this message]
2004-12-14 18:51 ` Harald Welte
2004-12-15 4:21 ` Rusty Russell
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=20041214183911.GA15606@apps.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=aebr@win.tue.nl \
--cc=akpm@osdl.org \
--cc=coreteam@netfilter.org \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@osdl.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