From: Remco Treffkorn <remco@rvt.com>
To: "David S. Miller" <davem@redhat.com>
Cc: dan@embeddededge.com, benh@kernel.crashing.org,
trini@kernel.crashing.org, rmk@arm.linux.org.uk,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.linuxppc.org
Subject: Re: 3 Serial issues up for discussion
Date: Tue, 30 Jul 2002 11:23:47 -0700 [thread overview]
Message-ID: <200207301123.48322.remco@rvt.com> (raw)
In-Reply-To: <20020729.195414.31386335.davem@redhat.com>
On Monday 29 July 2002 19:54, David S. Miller wrote:
> From: Remco Treffkorn <remco@rvt.com>
> Date: Mon, 29 Jul 2002 12:46:42 -0700
>
> Drivers need not fight about minor numbers. That can be simply handled:
>
> int get_new_serial_minor()
> {
> static int minor;
>
> return minor++;
> }
>
> Any serial driver can call this when it initializes a new uart.
> Hot pluggable drivers have to hang on to their minors, and
> re-use.
>
> I don't think it's wise to make hot-plug drivers keep track
> of the minors they ever use in such a sloppy way. Why not
> make the get_new_serial_minor() thing have a release method
> too and then we can keep track of minor allocation in one
> place.
>
> Also if I remmove the module for a serial port driver, those minors
> should get reused by the next registered uart too.
Point taken.
Here are a few more points.
The given solution presents almost zero overhead, but has the mentioned
problem. There is a way to allocate and free minor numbers, but that requires
storage. It could be handled like the fd_set's select uses. Just a bit field.
Bit cleared == minor available, bit set == in use.
If you want to do that, you would want to know the maximum number of minors
used. Also, finding the first cleared bit in your field costs more on some
platforms, than on others.
Although I suspect this additional overhead to not matter much, since
initialising a new uart is a rare event, I have bin surprised in the past.
So:
How many minors?
Is the overhead in getting a minor acceptable?
Is it worth doing?
Cheers,
Remco
--
Remco Treffkorn (RT445)
HAM DC2XT
remco@rvt.com (831) 685-1201
next prev parent reply other threads:[~2002-07-30 18:22 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-29 4:08 Serial core problems on embedded PPC David Gibson
2002-07-29 9:00 ` Russell King
2002-07-29 14:44 ` Tom Rini
2002-07-29 17:17 ` 3 Serial issues up for discussion (was: Re: Serial core problems on embedded PPC) Russell King
2002-07-29 17:43 ` Tom Rini
2002-07-29 18:13 ` Benjamin Herrenschmidt
2002-07-29 19:07 ` Tom Rini
2002-07-29 19:09 ` 3 Serial issues up for discussion (was: " Dan Malek
2002-07-29 19:46 ` Remco Treffkorn
2002-07-29 20:18 ` Russell King
2002-07-30 2:54 ` 3 Serial issues up for discussion David S. Miller
2002-07-30 18:23 ` Remco Treffkorn [this message]
2002-07-30 18:47 ` Nicolas Pitre
2002-07-30 18:51 ` Russell King
2002-07-30 18:44 ` Nicolas Pitre
2002-07-29 18:15 ` 3 Serial issues up for discussion (was: Re: Serial core problems on embedded PPC) Matt Porter
2002-07-29 17:47 ` [parisc-linux] " Christoph Plattner
2002-07-29 22:19 ` Matthew Wilcox
2002-07-30 14:36 ` Stuart MacDonald
2002-07-30 15:19 ` Matthew Wilcox
2002-07-30 15:43 ` Stuart MacDonald
2002-07-30 15:53 ` Russell King
2002-07-30 15:59 ` Greg KH
2002-07-30 16:06 ` Stuart MacDonald
2002-08-02 1:57 ` Jeff Randall
2002-07-30 2:51 ` 3 Serial issues up for discussion David S. Miller
2002-07-30 1:12 ` Serial core problems on embedded PPC David Gibson
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=200207301123.48322.remco@rvt.com \
--to=remco@rvt.com \
--cc=benh@kernel.crashing.org \
--cc=dan@embeddededge.com \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=rmk@arm.linux.org.uk \
--cc=trini@kernel.crashing.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