Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Apr 2002 01:06:48 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        "Andrew R. Reiter" <arr@FreeBSD.org>
Cc:        Alfred Perlstein <bright@mu.org>, smp@FreeBSD.org
Subject:   Re: Where to initialize certain locks...
Message-ID:  <3CA974A8.5440F3C9@mindspring.com>
References:  <Pine.NEB.3.96L.1020402031510.18134K-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
"Andrew R. Reiter" wrote:
> On Tue, 2 Apr 2002, Andrew R. Reiter wrote:
> :On Mon, 1 Apr 2002, Alfred Perlstein wrote:
> :
> ::Your concern is valid, perhaps a macro that automagically makes
> ::a sysinit to init a mutex?  Sort of like the "SYSCALL_MODULE_HELPER"
> ::stuff, but not as ugly?
> ::
> :
> :How about something along the lines of:
> 
> Sorry to reply to my own post, but I feel it necesary to mention that I
> dislike having to pass in sub and order...

As the original perpetrator of SYSINIT()...

What would you have suggested I do instead, to ensure explicit
ordering of operations, and the ability to hang operations off
as "before XXX" or "after XXX", without having the full set of
operations known at the time ever portion of the code was written?

Realize also that the LKM facility (replaced by KLD) was intended
to take the SYSINIT() sets out of modules that got loaded, and
use them to initialize them, for a totally modular environment,
in which the difference between a kernel module and a driver
linked into the kernel was intended to be "whether or not the .so
file was included in the kernel link line or not".

The current stuff almost achieves this (you still can't easily
distribute binary versions of drivers that need to go in the boot
or module loading path), and it will likely get there eventually.

The ordering has to be explicit because there is no way to
know the underlying coding assumptions for any arbitrary chunk
of source code, even if you have a "make depend": you don't get
the toplogy information about "system call A calls subsystem B
calls driver C fields interrupts with the common routine from
module D onto the mbuf queue defined in F and initialized in Q,
which must be called before R and S are called, or there's a
panic".

If you are going to complain about SYSINIT(), at least complain
about something like the bubble sort in init_main.c (so I can
dismiss it as a one-time operation that didn't need to be that
fast, compared to, say, not doing concurrent hardware probes
simultaneously for lack of a one-shot timer outcall mechanism).

;^).

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CA974A8.5440F3C9>