Date: Tue, 11 Jun 2002 00:55:21 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Harti Brandt <brandt@fokus.gmd.de> Cc: Maksim Yevmenkin <m_evmenkin@yahoo.com>, current@FreeBSD.ORG Subject: Re: Device cloning Message-ID: <3D05ACE9.ED09D57E@mindspring.com> References: <20020611085001.G33171-100000@beagle.fokus.gmd.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Harti Brandt wrote: > In MHO this idea is based on a fundamental misunderstanding of what a > device is under unix. If you need such a behaviour you should put another > abstraction on top of you devices (as the filesystem is put on top of > disks and sockets on top of network devices), that handle multiple > contexts for multiple processes. A device is just a device... I really disagree with this. SVR4 and AIX have supported clone devices for a very long time now, starting with support for pty's. Cloning eliminates several things: o The search requirement for allocating an instance of a device type; this is generally a linear search, through an O(n^2) interface, e.g. looking up the next pty in the space defined by /dev/pty* o The normal limit on the number of devices that's imposed because of both the namespace limits, and on static declaration of things that should be allocated on a per instance bases, up to the limits of system resources o The system dependence on naming that goes into building code that it portable between systems. For pty's, in particular, instance is identified via minor number; the need to actually try to open and obtain exclusive use of the master pty, up to the first unallocated one, and the fact that when you run out of names, you run out of pty's, are both enough, each on their own, to justify cloning devices. FreeBSD today can not run more than one VMWare seassion at a time because it lacks the ability to distinguish open instances to the device that exports the VMWare kernel context information to the user space application: because FreeBSD lacks device cloning. Rather than trying to say what someone should do, it'd be nice, at least in the case of commercial code that can't be demanded to be rewritten, and which runs under a non-native ABI on FreeBSD, to be able to support all of the functionality of the OS whose ABI is being emulated, and thus, if for no other reason, to support device cloning. It's not like third parties are going to be willing to port their code to FreeBSD, particularly after the last 6 years or so of being told *by FreeBSD people* to target the Linux ABI. So trying to change people wanting cloning in the first place is not really a winable fight. -- Terry 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?3D05ACE9.ED09D57E>