All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jidong Xiao <jidong.xiao@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Can we move device drivers into user-space?
Date: Sat, 25 Feb 2012 14:23:07 -0500	[thread overview]
Message-ID: <CAG4AFWb3y0GuKnun5Oiw7UEruUSaw78PoSxeyaXAN13o-aDrtw@mail.gmail.com> (raw)
In-Reply-To: <20120224165448.GA8751@kroah.com>

On Fri, Feb 24, 2012 at 11:54 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Feb 24, 2012 at 11:38:54AM -0500, Jidong Xiao wrote:
>> On Fri, Feb 24, 2012 at 10:38 AM, Greg KH <greg@kroah.com> wrote:
>> > On Fri, Feb 24, 2012 at 10:19:36AM -0500, Jidong Xiao wrote:
>> >> On Wed, Feb 22, 2012 at 11:56 PM, Jidong Xiao <jidong.xiao@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > I am just curious. Since the concept user-space device drivers has
>> >> > been proposed for several years, and some related projects and
>> >> > research papers have demonstrated the feasibility of of moving device
>> >> > drivers into use space. In particular, this paper:
>> >> >
>> >> > Tolerating Malicious Device Drivers in Linux.
>> >> > http://pdos.csail.mit.edu/papers/sud:usenix10.pdf
>> >> >
>> >> > In this paper, existing device driver code need not to be changed,
>> >> > which should help the idea to be applied in practice.
>
> Please note, that one of the strengths of Linux is that we CAN change
> driver code, and we do, which makes implementations like this nice from
> an academic point of view, but unrealistic from a real-world point of
> view.
>
>> >> Actually, my major concern is, since UIO has been accepted, then why
>> >> don't we move all the rest device drivers into user space as well. As
>> >> I understand, currently, some of device drivers are running on user
>> >> space, while the other (or say the majority of) device drivers are
>> >> running on kernel space, so why don't we maintain a consistent device
>> >> drivers infrastructure, say, either all in user space, or all in
>> >> kernel space. (Sure some critical device drivers still need to be kept
>> >> in kernel space.)
>> >
>> > Feel free to create patches to do so, and handle all of the userspace
>> > changes needed in order to implement this.
>> >
>> > I think you haven't thought through the true reason we have device
>> > drivers, and why Linux isn't a microkernel...
>> >
>> > And I'd take exception to your "advantage:" line above, I don't believe
>> > that is true at all.
>> >
>> > Best of luck with your work,
>> >
>> Although I was asking "can we" do something, I am not actually
>> strongly in favor of either move or not move, as indeed it costs too
>> much to do the moving job.
>
> Then why even discuss this at all?  What is your goal here?  If it is to
> have others do work based on an idea you pointed out, you are in the
> wrong place.
>
>> But when you say "handle all of the userspace changes needed in order
>> to implement this", if the device driver can be moved without
>> modification (like the paper above shows), there should not be much
>> changes required for user space applications.
>
> The paper shows one such implementation that purports to not need
> userspace changes.  As we have yet to see any code, I remain
> unconvinced.
>
>> Also, if user space device drivers is a bad idea, why drivers/uio has
>> been created and merged into mainline kernel?
>
> UIO fits a real need for some types of devices, why wouldn't it be
> merged?  You are trying to say it is to be used for all drivers, which
> is totally missing the point.
>
>> Regarding "And I'd take exception to your "advantage:" line above, I
>> don't believe that is true at all", do you agree that a significant
>> portion of kernel crash incidents are due to bugs in drivers?
>
> No I do not.  If you refer to the references from the paper where they
> make that claim, they are talking about a different operating system
> than Linux.  But, by virtue of the fact that the majority of the code
> running in your kernel is drivers, yes, odds are drivers will have a
> small majority of the bugs overall, given the percentages involved.
> However, the bugs-per-line-of-code for Linux drivers is _much_ less than
> other operating systems, especially given the fact that Linux drivers
> require much less lines of code overall than other operating systems
> (30% at the most for the majority of device types.)  So I would like to
> see real numbers backing up your claim before I agree with it.
>
Hi, Greg,

These two studies support my point. If the first one is too old, then
the second one should be more convincing. To save your time, you can
take a look at their conclusion first.

An Empirical Study of Operating Systems Errors
http://www.stanford.edu/~engler/metrics-sosp-01.pdf

Faults in Linux: Ten Years Later
http://pagesperso-systeme.lip6.fr/Suman.Saha/src/asplos11.pdf

Regards
Jidong

  parent reply	other threads:[~2012-02-25 19:23 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23  4:56 Can we move device drivers into user-space? Jidong Xiao
2012-02-23 15:57 ` Cong Wang
2012-02-23 16:34   ` Jidong Xiao
2012-02-23 20:48     ` david
2012-02-23 21:01       ` Jidong Xiao
2012-02-24 18:21         ` Mauro Carvalho Chehab
2012-02-25 15:10           ` Eduard - Gabriel Munteanu
2012-02-26  0:06             ` Mauro Carvalho Chehab
2012-02-26  0:29               ` Richard Yao
2012-02-27 11:31                 ` Mauro Carvalho Chehab
2012-02-26  1:58               ` Dr. David Alan Gilbert
2012-02-26  3:34                 ` arts zhao
2012-02-27 11:29                 ` Mauro Carvalho Chehab
2012-02-25 15:31           ` Richard Yao
2012-02-23 21:18       ` Roland Dreier
2012-02-24 15:19 ` Jidong Xiao
2012-02-24 15:38   ` Greg KH
2012-02-24 16:38     ` Jidong Xiao
2012-02-24 16:54       ` Greg KH
2012-02-24 17:06         ` Jidong Xiao
2012-02-24 17:13           ` Greg KH
2012-02-24 17:21             ` Jidong Xiao
2012-02-24 17:31               ` Greg KH
2012-02-25  2:33             ` Richard Yao
2012-02-25  4:28               ` Jidong Xiao
2012-02-24 17:10         ` Al Viro
2012-02-25 19:23         ` Jidong Xiao [this message]
2012-02-25 20:55           ` Greg KH
2012-02-25 23:43             ` Jidong Xiao
2012-02-26 17:40               ` Greg KH
2012-02-26 22:46             ` Greg KH
2012-02-27 11:17       ` Bernd Petrovitsch
2012-02-24 17:07     ` Guenter Roeck
2012-02-24 17:17       ` Greg KH
2012-02-24 17:47         ` Guenter Roeck
2012-02-24 18:34           ` Greg KH
2012-02-24 19:15             ` Henrik Rydberg
2012-02-24 19:26               ` Greg KH
2012-02-24 20:10                 ` Henrik Rydberg
2012-02-24 20:16                   ` Greg KH
2012-02-24 20:37                     ` Henrik Rydberg
2012-02-24 20:56                       ` Greg KH
2012-02-24 21:22                         ` Henrik Rydberg
2012-02-24 21:30                           ` Ted Ts'o
2012-02-24 22:14                             ` Henrik Rydberg
2012-02-24 22:20                               ` Greg KH
2012-02-24 22:49                                 ` Henrik Rydberg
2012-02-24 22:54                                   ` Greg KH
2012-02-24 23:14                                     ` Henrik Rydberg
2012-02-25 12:15                               ` Theodore Tso
2012-02-26  9:54                                 ` Henrik Rydberg
2012-02-26  4:56                               ` Bobby Powers
2012-02-26 10:47                                 ` Henrik Rydberg
2012-02-26 12:26                                   ` Richard Yao
2012-02-26 14:23                                     ` Bernd Petrovitsch
2012-02-26 15:29                                       ` Henrik Rydberg
     [not found]                                     ` <365b85cee33d4f1aadc31336663de21c@HUBCAS2.cs.stonybrook.edu>
2012-02-26 15:05                                       ` Richard Yao
2012-02-26 20:30                                         ` Ted Ts'o
     [not found]                                         ` <09a5cca9cffb4300843f682be529e8ca@HUBCAS2.cs.stonybrook.edu>
2012-02-26 21:25                                           ` Richard Yao
2012-02-26 21:35                                             ` Theodore Tso
     [not found]                                             ` <10de0ef9fb5d44c08669191e12343a97@HUBCAS2.cs.stonybrook.edu>
2012-02-26 22:03                                               ` Richard Yao
2012-02-27 11:17                                                 ` Bernd Petrovitsch
2012-02-26 23:08                                   ` david
2012-02-27  0:01                                     ` Henrik Rydberg
2012-02-27  0:53                                       ` david
2012-02-27  9:07                                         ` Henrik Rydberg
2012-03-01  9:54           ` Thomas Gleixner
2012-02-24 15:58   ` Valdis.Kletnieks

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=CAG4AFWb3y0GuKnun5Oiw7UEruUSaw78PoSxeyaXAN13o-aDrtw@mail.gmail.com \
    --to=jidong.xiao@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.