Re: [PATCH] alternative dev patch

From: Christoph Hellwig (hch@infradead.org)
Date: Sun Mar 23 2003 - 03:50:00 EST


On Thu, Mar 20, 2003 at 05:24:55PM -0800, Greg KH wrote:
> On Fri, Mar 21, 2003 at 12:03:57AM +0100, Roman Zippel wrote:
> > I'm unsure how your code will scale. It depends on how that code will be
> > used. If drivers register a lot of devices, your lookup function has to
> > scan a possibly very long list of minor devices and that function is
> > difficult to optimize.
>
> And then we grab the BKL :(

You're thinking the wrnog way around. Locking reduction / splitting is
trivial, getting the algorithms right is the hard part. Getting rid
of BKL in chardev open is a matter of simple search and replace and I expect
it to happen before 2.6.

> There are a number of char drivers that have "regions". The tty layer
> support them, and the usb core supports them as two examples. I'm sure
> there are others. Personally, I like the symmetry with the block device
> function the way Andries did it.

No, Andries did not do it symmetric to the block devices.

> > Even for block devices blk_register_region() is not the preferred
> > interface, you should use alloc_disk/add_disk instead. This will make it
> > easier to assign dynamic device numbers later.
>
> True, but dynamic device numbers can be built on top of the *_region()
> calls as it is today. Anyway, dynamic numbers are for 2.7 :)

Dynamic numbers are there today and have been for ages.

> No, I don't see /proc/misc going away due to the driver model,

I do see it going away. Dito for /proc/devices. They already are
inaccurate for those midlevel drivers that partition their major number
themselves and having the ranges properly exported like it's already
done for block devices is the proper replacement. Yes, this breaks
userspace and we'll have to live with it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:44 EST