|
Description
|
While doing some other work tonight, I came upon an oddity in uts/conf/param.c:
/*
* Streams tunables
*/
int nstrpush = 9;
--> int maxsepgcnt = 1;
I'd never heard of maxsepgcnt, which is no surprise -- nothing uses it.
However, I was a bit curious where it had come from, and began tracking it
back through the SCCS history. Oddly, it was introduced in a delta from
1989 that claimed to be adding numerous tunables from SVR4's master.d/kernel
file, but a search of the SVR4 tree turned up no references to it.
However SunOS4 also had a (primitive) STREAMS implementation -- had this
tunable accidentally made the galactic journey? A quick examination of the
SunOS 4.1.4 tree turned this up in usr/src/sys/os/str_buf.c:
/*
* allocate a stream event cell
*/
struct strevent *
sealloc(slpflag)
int slpflag;
{
register s;
register struct strevent *sep;
int i;
static sepgcnt = 0;
u_long a;
retry:
s = splstr();
if (sefreelist) {
sep = sefreelist;
sefreelist = sep->se_next;
(void) splx(s);
sep->se_procp = NULL;
sep->se_events = 0;
sep->se_next = NULL;
return (sep);
}
--> if (sepgcnt >= maxsepgcnt)
goto fail3;
sepgcnt++;
/*
* Allocate a new page of memory, overlay an event cell array on
* it and add it to the linked list of free cells.
*/
a = rmalloc(kernelmap, 1L);
Which not only answers the question of where this bizarre tunable came from,
but what it means: the maximum number of pages that can be consumed by
STREAMS events.
In any case, its lonely existence needs to be put to an end.
|