From owner-freebsd-smp Tue Apr 24 10:46:54 2001 Delivered-To: freebsd-smp@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id BAEDA37B423; Tue, 24 Apr 2001 10:46:47 -0700 (PDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.3/8.11.3) with SMTP id f3OHlIw18732; Tue, 24 Apr 2001 13:47:18 -0400 (EDT) (envelope-from arr@watson.org) Date: Tue, 24 Apr 2001 13:47:17 -0400 (EDT) From: "Andrew R. Reiter" To: Robert Watson Cc: John Baldwin , smp@FreeBSD.ORG Subject: RE: sysctl's and mutexes In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 24 Apr 2001, Robert Watson wrote: > On Tue, 24 Apr 2001, John Baldwin wrote: > > > > int jail_set_hostname_allowed = 1; > > > SYSCTL_INT(_jail, OID_AUTO, set_hostname_allowed, CTLFLAG_RW|CTLFLAG_MTX, > > > &jail_set_hostname_allowed, &jail_set_hostname_allowed_mtx, 0, > > > "Processes in jail can set their hostnames"); > > > > It might very well be desirable to add a new parameter for each sysctl > > that is a pointer to a mutex. However, an appropriate SYSINIT() or some > > such during startup needs to initialize that mutex before that sysctl is > > used. If need be, we can also add a flag to determine if the sysctl > > should initialize the mutex itself or not. Ideally then, we would > > create a new SYSINIT on the fly to initialize the mutex in question. I > > think though, that requiring explicit initialization of each mutex > > shouldn't be too hard. > > I don't have strong feelings on the exact nature of how mutices are bound > to sysctl's, as long as it's possible to do the following: > > 1) It should be possible to use an existing initialized mutex, especially > with regards to dynamically allocated sysctl's. > > 2) It should be possible for several sysctl's to share the same mutex. As in being able to say that for (and this might be a bad example) kern.timecounter.* mibs, could all share a mutex which is really "bound" to kern.timecounter in genera. Or do you mean just more generically the idea that multiple sysctl's can share a mutex and who/what shares a mutex is something to be decided? > > Robert N M Watson FreeBSD Core Team, TrustedBSD Project > robert@fledge.watson.org NAI Labs, Safeport Network Services > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-smp" in the body of the message > *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message