mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Andries.Brouwer@cwi.nl
Cc: linux-kernel@vger.kernel.org, <akpm@digeo.com>
Subject: Re: [PATCH] alternative dev patch
Date: Fri, 21 Mar 2003 00:03:57 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.44.0303202314210.5042-100000@serv> (raw)
In-Reply-To: <UTC200303202150.h2KLoEl09978.aeb@smtp.cwi.nl>

Hi,

On Thu, 20 Mar 2003 Andries.Brouwer@cwi.nl wrote:

> (i)
> There was some unused code, and you decide to start using that
> in order to speed up the open() of a chardev. Is that urgent?
> Is the speed of opening a chardev a bottleneck?

Currently it isn't, but it shouldn't become one?
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. If drivers want to avoid this they have to 
implement their own lookup function.
One other major reason for the "unused" code is to convert the 16/32/64bit 
dev_t as early as possible to either struct block_device/struct 
char_device, so the kernel mostly doesn't care about the dev_t resolution,
the character device core would match here the behaviour of the block 
device core.

> > 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.
> 
> What does one want? A driver announces the device number regions
> that it wants to cover. Simple and straightforward.
> Hardly a new idea. How is this done for block devices?
> Using blk_register_region(). How is register_chrdev_region()
> hiding problems? It eliminates the tty kludges that you only
> move to a different file.

char devices don't have partitions, so you hardly need regions. The 
problem with the tty layer is that the console and the serial devices 
should have different majors.
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.

> (iii)
> > this patch helps drivers to manage them without huge tables
> > (this latter part is also missing in Andries patch).
> 
> I am not sure I understand. Where are these huge tables?
> And how did you remove them?

See the misc device example. It doesn't have a table, but the list is now 
only needed to generate /proc/misc. As soon as character devices are 
better integrated into the driver model, even this list is not needed 
anymore. This means for simple character devices, we can easily add a 
alloc_chardev/add_chardev interface similiar to block devices.

bye, Roman


  reply	other threads:[~2003-03-20 22:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-20 21:50 Andries.Brouwer
2003-03-20 23:03 ` Roman Zippel [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2003-03-20  0:57 Roman Zippel
2003-03-20 20:40 ` 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.0303202314210.5042-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

all inboxes | Powered by JetHome®