public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bob Smith <bsmith@linuxtoys.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 001/001] CHAR DRIVERS: a simple device to give daemons a /sys-like interface
Date: Sun, 4 Aug 2013 06:38:28 +0800	[thread overview]
Message-ID: <20130803223828.GA14611@kroah.com> (raw)
In-Reply-To: <51FC5A97.1090102@linuxtoys.org>

On Fri, Aug 02, 2013 at 06:19:19PM -0700, Bob Smith wrote:
> This character device can give daemons an interface similar to
> the kernel's /sys and /proc interfaces.   It is a nice way to
> give user space drivers real device nodes in /dev.

Other comments about this patch:

> From 7ee4391af95b828179cf5627f8b431c3301c5057 Mon Sep 17 00:00:00 2001
> From: Bob Smith <bsmith@linuxtoys.org>
> Date: Fri, 2 Aug 2013 16:44:48 -0700
> Subject: [PATCH] PROXY, a driver that gives daemons a /sys like interface
> 

No signed-off-by:, or body of text here that explains what this is and
why it should be accepted.

> ---
>  Documentation/proxy.txt |   36 ++++
>  drivers/char/Kconfig    |    8 +
>  drivers/char/Makefile   |    2 +-
>  drivers/char/proxy.c    |  539 +++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 584 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/proxy.txt
>  create mode 100644 drivers/char/proxy.c
> 
> diff --git a/Documentation/proxy.txt b/Documentation/proxy.txt
> new file mode 100644
> index 0000000..6b9206a
> --- /dev/null
> +++ b/Documentation/proxy.txt
> @@ -0,0 +1,36 @@
> +Proxy Character Devices
> +
> +
> +Proxy is a small character device that connects two user space
> +processes.  It is intended to give user space daemons a /sys like
> +interface for configuration and status.
> +
> +As an example consider a daemon that controls a stepper motor. The
> +daemon would create and open one proxy device to read and write
> +configuration (/dev/stepper/config) and another proxy device to
> +accept a motor step count (/dev/stepper/count).
> +Shell commands to illustrate this example:
> +	$ stepper_daemon	# start the stepper control daemon
> +	$ # Set config to full steps, clockwise and 400 step/sec
> +	$ echo "full, cw, 400" > /dev/stepper/config
> +	$ # Now tell the motor to step 4000 steps
> +	$ echo 4000 > /dev/stepper/count
> +	$ sleep 2
> +	$ # How many steps remain?
> +	$ cat /dev/stepper/count
> +
> +
> +Proxy has some unique features that make ideal for providing a
> +/sys like interface.  It has no internal buffering.  The means
> +the daemon can not write until a client program is listening.
> +Both named pipes and pseudo-ttys have internal buffers.

So what is wrong with internal buffers?  Named pipes have been around
for a long time, they should be able to be used much like this, right?

> +Proxy will succeed on a write of zero bytes.  A zero byte write
> +gives the client an EOF.  The daemon in the example above would
> +use a zero byte write in the last command after it had written the
> +number of steps remaining.  No other IPC mechanism can close one
> +side of a device and leave the other side open.

No "direct" IPC, but you can always emulate this just fine with existing
IPC mechanisms.

> +Proxy works well with select(), an important feature for daemons.
> +In contrast, the FUSE filesystem has some issues with select() on
> +the client side.

What are those issues?  Why not just fix them?

Adding a new IPC function to the kernel should not be burried down in
drivers/char/.  We have 10+ different IPC mechanisms already, some
simple, some more complex.  Are you _sure_ none of the existing ones
will not work for you?  Maybe a simple userspace library that wraps the
existing mechanisms would be better (no kernel changes needed, portable
to any kernel release, etc.)?

thanks,

greg k-h

  parent reply	other threads:[~2013-08-03 22:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51FC5478.40500@linuxtoys.org>
2013-08-03  1:19 ` [PATCH 001/001] CHAR DRIVERS: a simple device to give daemons a /sys-like interface Bob Smith
2013-08-03  1:56   ` Joe Perches
2013-08-03  2:35   ` Greg Kroah-Hartman
2013-08-03 18:12     ` Bob Smith
2013-08-03 22:38   ` Greg Kroah-Hartman [this message]
2013-08-04 21:54     ` Bob Smith
2013-08-04 23:19       ` Greg Kroah-Hartman
2013-08-05 23:46         ` Bob Smith
2013-08-06  9:46           ` Greg Kroah-Hartman
2013-08-07 19:02             ` Bob Smith
2013-08-07 19:27               ` Greg Kroah-Hartman
2013-08-07 19:39                 ` Bob Smith
2013-08-07 19:51                   ` Greg Kroah-Hartman
2013-08-07 19:54                   ` Greg Kroah-Hartman
2013-08-07 21:04                     ` Bob Smith
2013-08-07 21:33                       ` Greg Kroah-Hartman
2013-08-08 21:23                         ` Bob Smith
2013-08-09 21:52                           ` Greg Kroah-Hartman
2013-08-09 22:20                             ` Bob Smith
2013-08-09 22:14                         ` Bob Smith
2013-08-09 23:01                           ` Greg Kroah-Hartman
2013-08-09 23:35                             ` Bob Smith
2013-08-09 23:46                               ` Greg Kroah-Hartman
2013-08-10 20:08                             ` Bob Smith
2013-08-10 20:29                               ` richard -rw- weinberger
2013-08-10 20:49                                 ` Bob Smith
2013-08-10 21:43                               ` Arnd Bergmann
2013-08-10 22:07                                 ` Bob Smith
2013-08-13 20:15                                   ` Arnd Bergmann
2013-08-07 21:28                     ` Bob Smith
2013-08-07 21:40                       ` Greg Kroah-Hartman
2013-08-07 21:53                         ` Bob Smith
2013-08-09 21:54                           ` Greg Kroah-Hartman
2013-08-09 22:51                             ` Bob Smith
2013-08-09 23:04                               ` Greg Kroah-Hartman
2013-08-07 21:38             ` Bob Smith

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=20130803223828.GA14611@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=bsmith@linuxtoys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox