Subject: Re: "const int" in conf/param.c?
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 04/25/1999 22:55:17
A few people have commented on why not leave msize and mclbytes in
conf/param.c as plain old patchable ints. Part of the reason was the
comment preceding the variables:
/*
* Actual network mbuf sizes (read-only), for netstat.
*/
These two variables aren't used anywhere in the kernel.
So I looked a bit further ... here's how each arch defines MSIZE and
MCLBYTES.
ARCH MSIZE MCLBYTES
alpha def 256 cond 1<<11
arm32 def 128 def 1<<11
bebox def 128 def 1<<11
i386 def 128 cond 1<<11
m68k def 128 cond 1<<11
macppc def 128 def 1<<11
news def 128 conf 1<<11
ofppc def 128 def 1<<11
pc532 cond 128 cond 1<<11
pica def 128 def 1<<11 (but gets MCLSHIFT wrong)
pmax def 128 cond 1<<11
powerpc def 128 def 1<<11
sparc def 128 def 1<<11
sparc64 def 128 def 1<<11
vax cond 128 cond 1<<11
Two questions arise from this:
+ Why does the alpha want 256 byte mbufs? If the 64 bit architecture
is really an issue, should sparc64 also have 256 byte mbufs?
+ Modulo the alpha mbuf size issue, should we move the default setting
of MSIZE and MCLBYTES to sys/param.h? We can have:
#ifndef MSIZE
#define MSIZE ...
#endif
#ifndef MCLSHIFT
#define MCLSHIFT ...
#endif
#define MCLBYTES (1 << MCLSHIFT)
and each port can override this if it wants to in machine/param.h if
it really wants to.
So, is there any real-world use for ever changing these sizes?
Along the same issue, there seems at first glance to be a lot in the
various machine/*.h files that is needlessly duplicated. Is it worth
the effort to clean all this up?
Simon.