From: Thomas Gleixner <tglx@linutronix.de>
To: Greg KH <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Benedikt Spranger <b.spranger@linutronix.de>,
"Hans J. Koch" <hjk@linutronix.de>
Subject: Re: [GIT PATCH] UIO patches for 2.6.21
Date: Sat, 28 Apr 2007 13:38:06 +0200 [thread overview]
Message-ID: <1177760287.7646.113.camel@localhost.localdomain> (raw)
In-Reply-To: <20070427231105.GA19156@suse.de>
On Fri, 2007-04-27 at 16:11 -0700, Greg KH wrote:
> > I'm a bit uncertain about the whole UIO idea, really. I have this vague
> > feeling that we'd prefer to encourage people to move device drivers into
> > GPL'ed kernel rather than encouraging them to do closed-source userspace
> > implementations which will probably end up being slower, less reliable and
> > unavailable on various architectures, distros, etc.
>
> It's not a closed vs. open issue, it just turns out that a lot of people
> keep trying to write PCI drivers in userspace (how many different papers
> were published on this topic alone in the past year...). This framework
> is to allow this to happen in a sane and correct way.
Right, we don't need another dozen of attempts to get it wrong.
Interestingly enough some talks at ELC were using UIO already for
testing and prototyping and the feedback from these guys was positive on
the technical side and not at all focussed on the ability to do closed
source hackery.
> Lots of different types of odd devices do not fit into the "kernelspace
> driver" framework very well for a variety of reasons:
> - zillions of different controls in the card
> - floating point is needed to compute the next step of an
> operation in moving a physical object
It's not necessarily slower. We were able to optimize an application by
using UIO and we got >20% performance gain, due to the fact that we can
operate on the device directly instead of copying data back and forth
between kernel and userspace for no good reason.
Removing the insane amount of 68 ioctls of the original in kernel
driver, which are just there to flip some bit in the chip registers is
definitely a win.
Having a sane user space driver instead of an eye-cancer causing kernel
driver and a user space library, which needs to hide the ioctl madness
away from the application programmer reduced the overall code size from
5264 lines of kernel code + 3275 lines of user space code
to
156 lines of kernel code + 2970 lines of user space code.
> With this framework, we provide a solid and simple way to provide for
> these kinds of devices. The Linutronix guys have had a lot of
> experience in supporting this kind of hardware in the past and can
> provide better examples if you need.
UIO is not targeted on devices which are part of a kernel subsystem, it
is targeted for self contained special devices, which have currently
tons of out of tree drivers with an average quality of 0. Those devices
do not fit in the in kernel driver landscape at all and we really should
give those folks something sane to work from.
> But yes, it does allow you to write a PCI driver in userspace, being
> closed source, if you really want to. But if you do that, then you get
> _no_ advantages of being in the kernel (caching, common userspace
> interface, resource management, etc.) and need to handle that all
> yourself. Heck, that's pretty much what X does today for lots of old
> video cards :)
Right, you can do closed source drivers and I prefer when people use
this interface instead of fiddling with faked licenses and creating
legal bordercases.
All drivers we did so far have LGPL user space counterparts and that's
the preferred way to go.
Also we have the user space driver support for USB already and I have
not seen negative impact from this one yet.
> > > drivers/uio/uio_cif.c | 156 ++++++++
> >
> > eh? How come a particular device requires 156 lines of kernel code to
> > support a userspace driver? Doesn't that kind of defeat the point?
>
> No, you still need kernel code to handle the interrupt properly, we do
> not want userspace to do this as it would slow the system down and do
> all sorts of other bad things. That's the main problem with all of
> those other proposals that people have for trying to do this kind of
> work in the past (can't share irqs, can't block on userspace in an
> interrupt handler, etc.)
Ack.
tglx
next prev parent reply other threads:[~2007-04-28 11:36 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-27 22:49 [GIT PATCH] UIO patches for 2.6.21 Greg KH
2007-04-27 22:50 ` [PATCH 1/3] UIO: Add the User IO core code Greg Kroah-Hartman
2007-04-27 22:50 ` [PATCH 2/3] UIO: Documentation Greg Kroah-Hartman
2007-04-27 22:50 ` [PATCH 3/3] UIO: Hilscher CIF card driver Greg Kroah-Hartman
2007-04-29 19:44 ` [PATCH 3/3] UIO: Hilscher CIF card driver (with patch) Hans-Jürgen Koch
2007-05-01 23:42 ` [PATCH 2/3] UIO: Documentation Randy Dunlap
2007-05-02 8:41 ` Hans-Jürgen Koch
2007-05-02 20:52 ` Randy Dunlap
2007-05-02 22:00 ` Hans-Jürgen Koch
2007-05-02 23:37 ` Randy Dunlap
2007-05-03 5:37 ` Greg KH
2007-05-03 6:39 ` Hans-Jürgen Koch
2007-05-04 9:37 ` Hans-Jürgen Koch
2007-05-07 17:46 ` Randy Dunlap
2007-05-07 20:01 ` Hans-Jürgen Koch
2007-04-27 23:19 ` Flaws with "UIO: Add the User IO core code" Alan Cox
2007-04-28 11:39 ` Thomas Gleixner
2007-04-28 18:52 ` Flaws with "UIO: Add the User IO core code" (with patch) Hans-Jürgen Koch
2007-04-28 20:24 ` Alan Cox
2007-04-28 20:38 ` Thomas Gleixner
2007-04-28 21:03 ` Hans-Jürgen Koch
2007-04-28 21:08 ` Thomas Gleixner
2007-04-28 21:14 ` Flaws with "UIO: Add the User IO core code" Hans-Jürgen Koch
2007-04-29 22:18 ` Flaws with "UIO: Add the User IO core code" (with patch) Hans-Jürgen Koch
2007-04-27 23:04 ` [GIT PATCH] UIO patches for 2.6.21 Andrew Morton
2007-04-27 23:11 ` Greg KH
2007-04-28 11:38 ` Thomas Gleixner [this message]
2007-04-27 23:26 ` Alan Cox
2007-04-28 0:28 ` Hans-Jürgen Koch
2007-04-28 13:00 ` Matthieu CASTET
2007-04-28 13:49 ` Hans-Jürgen Koch
2007-04-28 19:56 ` Bill Davidsen
2007-04-28 20:02 ` Thomas Gleixner
2007-04-28 20:03 ` Hans-Jürgen Koch
2007-04-28 20:15 ` Alan Cox
2007-04-28 20:31 ` Thomas Gleixner
2007-04-29 1:23 ` Greg KH
2007-04-29 8:30 ` Thomas Gleixner
2007-04-29 12:09 ` Jan Engelhardt
2007-04-29 16:27 ` Alan Cox
2007-05-07 20:02 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2007-05-08 14:04 Greg KH
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=1177760287.7646.113.camel@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=b.spranger@linutronix.de \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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