netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Eric Paris <eparis@redhat.com>
Cc: David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	netdev@vger.kernel.org, viro@zeniv.linux.org.uk,
	alan@linux.intel.com, hch@infradead.org
Subject: Re: [PATCH 1/8] networking/fanotify: declare fanotify socket numbers
Date: Fri, 11 Sep 2009 22:27:31 +0100	[thread overview]
Message-ID: <20090911212731.GA19901@shareable.org> (raw)
In-Reply-To: <1252703626.2305.50.camel@dhcp231-106.rdu.redhat.com>

Eric Paris wrote:
> On Fri, 2009-09-11 at 21:46 +0100, Jamie Lokier wrote:
> > Eric Paris wrote:
> > > > I would really prefer if you worked on eliminating the problem that
> > > > prevents you from using netlink instead.
> > > 
> > > I'm not really sure if I can, although I'd love to hear input from
> > > someone who knows the netlink code on how I can make it do what I need.
> > > I'm really not duplicating much other than the NLMSG_OK and NLMSG_NEXT
> > > macros.  My code doesn't even use skbs and I'm not savy enough to really
> > > know how I could.  I'm more than willing to work on it if someone can
> > > point me to how it might work.
> > 
> > Let's turn the question around.
> > 
> > Since you're doing lots of non-sockety things, and can't tolerate
> > dropped packets - why isn't it a character device?  What's the reason
> > for using a socket at all?
> > 
> > (I'm reminded of /dev/poll, /dev/epoll and /dev/inotify :-)
> 
> Originally it was a char device and I was told to use a socket protocol
> so I could use get/set sockopt rather than ioctl, because ioctl is the
> devil (even if those aren't THAT much better).
> 
> The queuing being done using events instead of skbs was done reusing
> inotify code, reusing network code would be just as good with me.  What
> I really need is a way to convey a pointer from one process to another.
> That's why I claim loss is not an option, since I'm holding a reference
> to the pointer I can't have that conveyance disappear under us.

It's fine as long as the disappearing knows to releas the reference.
But I suspect fanotify would be awfully hard to use if messages were
unreliable.

> If network people want me to get back out of the network system I can go
> back to a char file with lots of ioctls.  I'd love to reuse code, I just
> don't know what's possible...

Ok.  I understand you're pushed in different directions by different
schools of thought.

Let's look at some history.  What happened to /dev/epoll.  It worked
very well (and several OSes have /dev/poll which is similar).  There
was no technical reason to change the interface.

But when it came to mainlining it, Linus objected, and forced it to
become a small set of system calls.  It's quite a nice interface to
use now.

Then /dev/inotify.  You know what happened.  The history was similar:
Linux objected to the device, and forced it to use a few system calls.

More recently, people skipped over the /dev path, having seen how it
went before, and just implemented things like timerfd, eventfd and
signalfd system calls.

That seems to be the Linux way - if the interface can be exposed as a
small set of sensible system calls, and it's really a core kernel
facility.

Does fanotify need "lots of ioctls", or could it fit comfortably into
say 2-5 strongly typed system calls, like inotify and epoll do?

-- Jamie

  reply	other threads:[~2009-09-11 21:27 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  5:25 [PATCH 1/8] networking/fanotify: declare fanotify socket numbers Eric Paris
2009-09-11  5:26 ` [PATCH 2/8] vfs: introduce FMODE_NONOTIFY Eric Paris
2009-09-11  5:26 ` [PATCH 3/8] fanotify: fscking all notification system Eric Paris
2009-09-11  5:26 ` [PATCH 4/8] fanotify:drop notification if they exist in the outgoing queue Eric Paris
2009-09-11  5:26 ` [PATCH 5/8] fanotify: merge notification events with different masks Eric Paris
2009-09-11  5:26 ` [PATCH 6/8] fanotify: userspace socket Eric Paris
2009-09-11  5:26 ` [PATCH 7/8] fanotify: userspace can add and remove fsnotify inode marks Eric Paris
2009-09-11  5:26 ` [PATCH 8/8] fanotify: send events to userspace over socket reads Eric Paris
2009-09-11 14:08   ` Daniel Walker
2009-09-11 14:15     ` Eric Paris
2009-09-11 14:22       ` Daniel Walker
2009-09-11 14:32       ` Daniel Walker
2009-09-11 14:32 ` [PATCH 1/8] networking/fanotify: declare fanotify socket numbers Andreas Gruenbacher
2009-09-11 16:04   ` Eric Paris
2009-09-11 18:46 ` David Miller
2009-09-11 19:33   ` Eric Paris
2009-09-11 20:46     ` Jamie Lokier
2009-09-11 21:13       ` Eric Paris
2009-09-11 21:27         ` Jamie Lokier [this message]
2009-09-11 21:51           ` Eric Paris
2009-09-12  9:41             ` Evgeniy Polyakov
2009-09-14  0:17               ` Jamie Lokier
2009-09-14 14:07                 ` Evgeniy Polyakov
2009-09-14 19:08                   ` fanotify as syscalls Eric Paris
2009-09-15 20:16                     ` Evgeniy Polyakov
2009-09-15 21:54                       ` Eric Paris
2009-09-15 23:49                         ` Linus Torvalds
2009-09-16  1:26                           ` Eric Paris
2009-09-16  7:52                             ` Jamie Lokier
2009-09-16  9:48                               ` Eric Paris
2009-09-16 12:17                                 ` Jamie Lokier
2009-09-17 20:07                                   ` Andreas Gruenbacher
2009-09-18 20:52                                     ` Eric Paris
2009-09-18 22:00                                       ` Andreas Gruenbacher
2009-09-19  3:04                                         ` Eric Paris
2009-09-21 20:04                                           ` Andreas Gruenbacher
2009-09-21 20:28                                             ` Jamie Lokier
2009-09-21 21:27                                               ` Andreas Gruenbacher
2009-09-21 22:00                                                 ` Jamie Lokier
2009-09-21 23:09                                                   ` Andreas Gruenbacher
2009-09-21 23:56                                                     ` Jamie Lokier
2009-09-21 22:18                                               ` Davide Libenzi
2009-09-21 23:12                                                 ` Jamie Lokier
2009-09-22 14:51                                                   ` Davide Libenzi
2009-09-22 15:31                                                     ` Andreas Gruenbacher
2009-09-22 16:04                                                       ` Davide Libenzi
2009-09-23  8:39                                                         ` Tvrtko Ursulin
2009-09-23 11:20                                                           ` hch
2009-09-23 15:35                                                             ` Davide Libenzi
2009-09-23 21:58                                                               ` hch
2009-09-23 11:32                                                           ` Arjan van de Ven
2009-09-23 15:42                                                             ` Tvrtko Ursulin
2009-09-23 15:51                                                             ` Eric Paris
2009-09-23 21:56                                                               ` hch
2009-09-23 15:26                                                           ` Davide Libenzi
2009-09-23 15:45                                                             ` Tvrtko Ursulin
2009-09-23 17:31                                                               ` Davide Libenzi
2009-09-22 16:11                                                       ` Eric Paris
2009-09-22 16:27                                                         ` Jamie Lokier
2009-09-22 23:43                                                           ` Davide Libenzi
2009-09-22 21:06                                             ` Eric Paris
2009-09-22 21:38                                               ` Andreas Gruenbacher
2009-09-16 10:41                               ` Alan Cox
2009-09-16 11:41                                 ` Jamie Lokier
2009-09-16 12:01                                   ` Alan Cox
2009-09-16 12:56                                     ` Jamie Lokier
2009-09-16 15:53                                       ` Eric Paris
2009-09-16 21:49                                         ` Jamie Lokier
2009-09-16 22:33                                           ` Eric Paris
2009-09-16 11:30                         ` Arnd Bergmann
2009-09-16 12:05                         ` Evgeniy Polyakov
2009-09-16 12:27                           ` Jamie Lokier
2009-09-17 16:40                             ` Linus Torvalds
2009-09-17 17:35                               ` Arjan van de Ven
2009-09-17 18:53                               ` Eric Paris
2009-09-22  0:15                               ` Eric W. Biederman
2009-09-22  0:22                                 ` Randy Dunlap
2009-09-11 21:21     ` [PATCH 1/8] networking/fanotify: declare fanotify socket numbers jamal
2009-09-11 21:42       ` Jamie Lokier
2009-09-11 22:52         ` jamal
2009-09-14  0:03           ` Jamie Lokier
2009-09-14  1:26             ` Eric Paris
2009-09-14 13:15             ` jamal
2009-09-12  9:47         ` Evgeniy Polyakov

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=20090911212731.GA19901@shareable.org \
    --to=jamie@shareable.org \
    --cc=alan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=eparis@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).