Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 1998 21:40:26 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        grog@lemis.com (Greg Lehey)
Cc:        phk@critter.freebsd.dk, gibbs@narnia.plutotech.com, current@FreeBSD.ORG
Subject:   Re: Slice implementation (was: Current is Really Broken(tm))
Message-ID:  <199809272140.OAA00439@usr05.primenet.com>
In-Reply-To: <19980927175655.P20205@freebie.lemis.com> from "Greg Lehey" at Sep 27, 98 05:56:55 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I can't see anything in this discussion which requires process
> context.

The I/O's to the disk to probe the SLICE driver format, and the
allocation of a device descriptor for enqueueing the device
arrival event for physical devices, which "arrive" by driver
probe returning "true".

There is the need for, minimally, a kernel thread to field and
process physical media arrival events.


> I considered these options when writing Vinum, which is hairier than I
> want it to be.  I decided against both of these alternatives, and for
> a third one: put it in an LKM.  It's not going to work completely,
> because I need process context for I/O error recovery, but that's
> about the only thing.  

If you need help on starting a kernel thread (process) in an LKM,
I can give you info.  The easiest thing to do is to look at the
code in /sys/kern/init_main.c and see how the swapper, pagedaemon,
vmdaemon, and update (or syncd) are started.


> Tandem solved this problem decades ago: when you open a file, you
> specify an exclusion parameter, which can be "shared" (no exclusion),
> "protected" (anybody can read, only I can write), or "exclusive"
> (nobody else can access).  There's also a parameter which specifies to
> wait until the file is available for access in the desired mode.  This
> works very well.  Applying the solution to UNIX is less a question of
> the implementation than of implementing it in a backwards-compatible
> manner.

O_EXLOCK, O_SHLOCK 8-).

But I would prefer to enforce a procedural interface instead of a
data interface (i.e., use an ioctl() to manipulate the SLICE
objects, instead of expecting the SLICE code to notice Joe Schmuck
User writing disklabels on defenseless devices).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809272140.OAA00439>