From: Roman Zippel <zippel@linux-m68k.org>
To: linux-kernel@vger.kernel.org
Cc: Andries.Brouwer@cwi.nl, Andrew Morton <akpm@digeo.com>
Subject: Re: [PATCH] alternative dev patch
Date: Thu, 20 Mar 2003 21:40:32 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.44.0303202131470.12110-100000@serv> (raw)
In-Reply-To: <Pine.LNX.4.44.0303200140050.12110-100000@serv>
Hi,
On Thu, 20 Mar 2003, Roman Zippel wrote:
> This patch makes use of the character device hash and avoids introducing
> unnecessary interfaces. I also moved the tty hack where it belongs.
> As an example I converted the misc device to demonstrate how drivers can
> make use of it.
> Probably the most interesting part is how the open path stays short and
> fast.
Here is a more detailed explanation of the patch and how it compares to
Andries patch.
The open path for most devices is quite simple and tries to avoid a lookup
by using the cached value in inode->i_cdev, so it simply has to get
inode->i_cdev->fops. Only if that fails, open tries the slow path looking
up the major device. Andries removes all the infrastructure for this with
the first patch and replaces it with a lookup which can be quite expensive
(e.g. when a major device has a lot of minor devices registered).
Further he introduces a new function register_chrdev_region(), which is
only needed by the tty code and rather hides the problem than solves
it. So the complexity should stay in the tty layer (and has to be fixed
there), than forcing it into the generic layer.
The misc device example is interesting that misc_open() now is only called
if no misc device is registered for that minor, so it only needs to
request a module. The remaining functionality is basically to export
information about misc devices to userspace and even part of that could be
moved into the generic part (e.g. part of the driver model, but that
depends a lot on what the tty layer needs).
Overall the generic code is 32bit dev_t safe (+ minor fixes/
optimizations). A flag still needs to be added, whether a driver can
handle more than 256 minor numbers, but this patch helps drivers to manage
them without huge tables (this latter part is also missing in Andries
patch).
bye, Roman
next prev parent reply other threads:[~2003-03-20 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-20 0:57 [PATCH] alternative dev patch Roman Zippel
2003-03-20 20:40 ` Roman Zippel [this message]
2003-03-20 21:50 Andries.Brouwer
2003-03-20 23:03 ` Roman Zippel
2003-03-21 1:24 ` Greg KH
2003-03-21 9:08 ` Roman Zippel
2003-03-22 1:38 ` Greg KH
2003-03-22 13:02 ` Roman Zippel
2003-03-23 8:19 ` Greg KH
2003-03-23 8:30 ` Christoph Hellwig
2003-03-23 15:05 ` Roman Zippel
2003-03-23 16:32 ` Christoph Hellwig
2003-03-23 8:50 ` Christoph Hellwig
2003-03-23 8:46 ` Christoph Hellwig
2003-03-23 15:11 ` Roman Zippel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0303202131470.12110-100000@serv \
--to=zippel@linux-m68k.org \
--cc=Andries.Brouwer@cwi.nl \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).