From: Bill Gatliff <bgat@billgatliff.com>
To: Marco Stornelli <marco.stornelli@coritel.it>
Cc: "Douglas, Jim (Jim)" <jdouglas@avaya.com>,
Embedded Linux mailing list <linux-embedded@vger.kernel.org>
Subject: Re: UIO - interrupt performance
Date: Mon, 20 Oct 2008 11:13:10 -0500 [thread overview]
Message-ID: <48FCAE16.70509@billgatliff.com> (raw)
In-Reply-To: <48FC71BD.9070703@coritel.it>
Marco Stornelli wrote:
> I quite agree with Ben and Christian. I think UIO drivers are usable for
> simple devices, I think they aren't mature (will it ever be?) to use it
> with complicated devices or with strict requirement.
I disagree. Completely.
I recall seeing a report from the Gelato project, where they reimplemented an
IDE driver under UIO. IIRC, their test results showed at least 80% of the
in-kernel performance--- and this was a very early UIO implementation, I would
guess that things are much improved since then. I know that IDE isn't a USBH,
but it isn't a GPIO LED, either. :)
If you are concerned about timeliness of execution, then if you have never heard
of POSIX.1b then you shouldn't be writing Linux code anyway. But if you do use
the features that POSIX.1b gives you, then I haven't found UIO to be objectionable.
From a performance standpoint, the major differences between UIO vs. in-kernel
are (a) a _possible_ additional context switch at each interrupt, to transfer
control back to the userspace responder, and (b) the elimination of a syscall to
push data through an in-kernel interface back to the device. Only your own
testing with your own hardware and application can tell you if that's a net
improvement or regression and where--- if anywhere--- you take the hit.
The general upsides with UIO are huge: you can debug your driver with gdb, and
you can bind your driver tightly to your application if it makes sense to do so.
Every i/o action is potentially zero-copy straight into the correct data
structures, for example. For some workloads, that puts UIO way ahead of an
in-kernel driver without the complexity of mmap().
As an aside, if you really need an interface that resembles a device node then
you can emulate that in userspace with a FIFO. That lets you put the driver in
a standalone program if you like, and other user applications can't tell the
difference between that and a true device node. (They can figure it out if they
need to, but if they just are using open/close/read/write then they don't care).
The social downside to UIO is that you'll never get your driver(s) mainlined,
since Linux-the-kernel doesn't run in userspace. :)
Put simply, you can't dismiss UIO lightly unless you haven't worked with or
reviewed the code behind it.
b.g.
--
Bill Gatliff
bgat@billgatliff.com
next prev parent reply other threads:[~2008-10-20 16:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-20 9:55 UIO - interrupt performance Douglas, Jim (Jim)
2008-10-20 10:28 ` Ben Nizette
[not found] ` <Pine.LNX.4.58.0810200258210.2562@vlab.hofr.at>
2008-10-20 22:12 ` Ben Nizette
2008-10-21 6:57 ` Wolfgang Grandegger
2008-10-21 9:32 ` Ben Nizette
2008-10-20 10:30 ` Christian SCHWARZ
2008-10-20 11:55 ` Marco Stornelli
2008-10-20 13:20 ` Paul Mundt
2008-10-20 16:13 ` Bill Gatliff [this message]
2008-10-21 8:36 ` Marco Stornelli
2008-10-21 9:01 ` Alessio Igor Bogani
2008-10-21 9:30 ` Marco Stornelli
2008-10-21 9:37 ` Ben Nizette
2008-10-21 10:24 ` Marco Stornelli
2008-10-21 10:28 ` Wolfgang Grandegger
2008-10-21 11:39 ` Bill Gatliff
2008-10-20 12:48 ` Thomas Petazzoni
2008-10-20 16:25 ` Bill Gatliff
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=48FCAE16.70509@billgatliff.com \
--to=bgat@billgatliff.com \
--cc=jdouglas@avaya.com \
--cc=linux-embedded@vger.kernel.org \
--cc=marco.stornelli@coritel.it \
/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).