From: Christoph Hellwig <hch@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Christoph Hellwig <hch@infradead.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: ioctls vs syscalls once again
Date: Fri, 21 Aug 2009 14:18:23 -0400 [thread overview]
Message-ID: <20090821181823.GA29918@infradead.org> (raw)
In-Reply-To: <20090821124638.GC10263@elte.hu>
[chaged the subject and droped the cc list down as this is not about
discard support anymore]
On Fri, Aug 21, 2009 at 02:46:38PM +0200, Ingo Molnar wrote:
> > ioctl is per defintion a multiplexer.
>
> Yes, and? There's two variants of multiplexing:
>
> - multiplex something rather straightforward and related
> - multiplex unrelated fields, data, structures
>
> I consider the second one 'ugly', the first one 'ok-ish'. YMMV.
Exactly. And ioctl is per defintion the latter. sys_ioctl is a way
to give drivers (and in Linux filesystem, too) a way to implement their
own syscall table extension for file descritors they control. While
there might be a few "ok-ish" or "nice" ioctl handlers most of them
are ugly. That's why people don't like them too much, btw :)
> I'd like to understand the technical basis of your critisism and i'd
> like to address any deficiencies of the perfcounters code. You said
> you dont like the ioctl solution we have, but that you'd like a
> separate syscall even less.
I really don't like any ioctl solution very much. But sometimes it's
the lesser of the evils, often by a bug margin.
> Perfcounters are a kernel-wide concept, encompassing 100% of all
> Linux installations, not just some special hardware.
That doesn't really matter. The tty code is also used by 100% of the
Linux installation, and still it implements the tty controls as ioctls.
Generally having system calls that don't operate on file descriptor
genericly (that doesn't mean implemented everywhere, but beeing a
generic concept dispatched through file operations) is pretty ugly.
We have a lot of them anyway, e.g. the socket system calls, eventfd,
inotify. They don't really buy us anything over ioctls, but they
are accepted. So if you design a clean system call working on
perfcounters file descriptor no one could have hard objection (as in
actually saying no). But if you really just do another stupid
muliplexer just go for ioctl instead of reinventing the dispatching
and multiplexing.
next prev parent reply other threads:[~2009-08-21 18:18 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 0:47 [PATCH, RFC] xfs: batched discard support Christoph Hellwig
2009-08-16 0:47 ` Christoph Hellwig
2009-08-16 1:35 ` Mark Lord
2009-08-16 1:35 ` Mark Lord
2009-08-16 2:19 ` Mark Lord
2009-08-16 2:19 ` Mark Lord
2009-08-16 2:25 ` Christoph Hellwig
2009-08-16 2:25 ` Christoph Hellwig
2009-08-16 2:49 ` Mark Lord
2009-08-16 2:49 ` Mark Lord
2009-08-16 3:25 ` Mark Lord
2009-08-16 3:25 ` Mark Lord
2009-08-16 13:00 ` Mark Lord
2009-08-16 13:00 ` Mark Lord
2009-08-16 13:53 ` Christoph Hellwig
2009-08-16 13:53 ` Christoph Hellwig
2009-08-16 13:59 ` Mark Lord
2009-08-16 13:59 ` Mark Lord
2009-08-16 14:06 ` Mark Lord
2009-08-16 14:06 ` Mark Lord
2009-08-16 14:23 ` Christoph Hellwig
2009-08-16 14:23 ` Christoph Hellwig
2009-08-16 14:26 ` Mark Lord
2009-08-16 14:26 ` Mark Lord
2009-08-19 20:39 ` Ingo Molnar
2009-08-19 20:39 ` Ingo Molnar
2009-08-20 1:05 ` Christoph Hellwig
2009-08-20 1:05 ` Christoph Hellwig
2009-08-20 1:10 ` Jamie Lokier
2009-08-20 1:10 ` Jamie Lokier
2009-08-20 1:38 ` Douglas Gilbert
2009-08-20 1:38 ` Douglas Gilbert
2009-08-20 1:38 ` Mark Lord
2009-08-20 1:38 ` Mark Lord
2009-08-21 12:46 ` Ingo Molnar
2009-08-21 12:46 ` Ingo Molnar
2009-08-21 18:18 ` Christoph Hellwig [this message]
2009-08-21 20:35 ` ioctls vs syscalls once again Ingo Molnar
2009-08-20 1:39 ` [PATCH, RFC] xfs: batched discard support Mark Lord
2009-08-20 1:39 ` Mark Lord
2009-08-20 13:48 ` Ric Wheeler
2009-08-20 14:38 ` Mark Lord
2009-08-20 14:38 ` Mark Lord
2009-08-20 14:42 ` Ric Wheeler
2009-08-20 14:42 ` Ric Wheeler
2009-08-20 17:19 ` Greg Freemyer
2009-08-20 17:19 ` Greg Freemyer
2009-08-20 14:42 ` James Bottomley
2009-08-20 14:42 ` James Bottomley
2009-08-20 15:43 ` Rolf Eike Beer
2009-08-20 15:43 ` Rolf Eike Beer
2009-08-20 17:00 ` Ric Wheeler
2009-08-20 17:00 ` Ric Wheeler
2009-08-20 14:58 ` Douglas Gilbert
2009-08-20 14:58 ` Douglas Gilbert
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=20090821181823.GA29918@infradead.org \
--to=hch@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=torvalds@linux-foundation.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.