mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Elson <jelson@circlemud.org>
To: Alexander Viro <viro@math.psu.edu>
Cc: Abramo Bagnara <abramo@alsa-project.org>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-kernel@vger.kernel.org
Subject: Re: Mapping a piece of one process' addrspace to another?
Date: Wed, 07 Mar 2001 13:02:04 -0800	[thread overview]
Message-ID: <200103072102.f27L24w09461@servo.isi.edu> (raw)
In-Reply-To: Message from Alexander Viro <viro@math.psu.edu>  of "Wed, 07 Mar 2001 04:49:56 EST." <Pine.GSO.4.21.0103070429140.2127-100000@weyl.math.psu.edu>

Alexander Viro writes:
>Erm. If ioctls are device-specific - the program is already bound to
>specific driver. If they are for class of devices (and if I guessed
>right that's the case you are interested in - sound, isn't it?) we
>could let the stub driver in kernel open two pipes and redirect
>read()/write() on device to the first one turn ioctls into read()/write()
>on the second. That way you can get userland programs serving that
>stuff with no magic required.

One problem, in addition to the points Abramo made, is that there's no
metadata that goes along with the data you're writing to the pipe.
This is fine as long as there's only one process reading, but in the
case of a single driver serving multiple instances of an open file,
there has to be some way for the userspace driver to communicate to
the kernel which open file needs to get the data.

A similar problem is that metadata needs to accompany the read request
when the userspace driver gets it (i.e., current file position, file
flags, size of the read that was requested, etc.)  Although, that data
might be transmitted on the OOB channel.

Also, even though my framework right now only does character devices,
it's a pretty simple extension to support userspace block devices and
network devices as well.  In these cases I think using a pipe gets
more and more complicated.

>From reading all the responses to the thread (thanks, everyone, for
your useful comments), it sounds like the best thing to do is use
Manfred's zerocopy pipe code as a model and implement something
similar in my framework.  It's not really that much code anyway so
it's not much of a waste reimplementing it.  And, I think
reimplementing those 30 lines will be much simpler than trying to
manage 2 parallel channels.  If the zerocopy patch becomes part of the
kernel anyway, it gets even simpler, since I can probably just call
pio_copy_to_user instead of copying it.

Regards,
Jer

  parent reply	other threads:[~2001-03-07 21:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-07  5:19 Jeremy Elson
2001-03-07  5:55 ` Alexander Viro
2001-03-07  6:02   ` Marcelo Tosatti
2001-03-07  8:13     ` Jeremy Elson
2001-03-07  8:40       ` Alexander Viro
2001-03-07  8:54         ` Jeremy Elson
2001-03-07  9:09           ` Alexander Viro
2001-03-07 23:22             ` James H. Cloos Jr.
2001-03-07  9:04         ` Abramo Bagnara
2001-03-07  9:10           ` Alexander Viro
2001-03-07  9:20             ` Abramo Bagnara
2001-03-07  9:49               ` Alexander Viro
2001-03-07 13:01                 ` Abramo Bagnara
2001-03-07 21:02                 ` Jeremy Elson [this message]
2001-03-07  8:58       ` Abramo Bagnara
2001-03-07 18:17     ` Pavel Machek
2001-03-07 10:51 Manfred Spraul
2001-03-07 13:57 Jesse Pollard

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=200103072102.f27L24w09461@servo.isi.edu \
    --to=jelson@circlemud.org \
    --cc=abramo@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=viro@math.psu.edu \
    /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®