|
|
Subscribe / Log in / New account

Re: Syslets, Threadlets, generic AIO support, v6

From:  Linus Torvalds <torvalds-AT-linux-foundation.org>
To:  Ingo Molnar <mingo-AT-elte.hu>
Subject:  Re: Syslets, Threadlets, generic AIO support, v6
Date:  Wed, 30 May 2007 08:16:46 -0700 (PDT)
Cc:  Ulrich Drepper <drepper-AT-redhat.com>, Jeff Garzik <jeff-AT-garzik.org>, Zach Brown <zach.brown-AT-oracle.com>, linux-kernel-AT-vger.kernel.org, Arjan van de Ven <arjan-AT-infradead.org>, Christoph Hellwig <hch-AT-infradead.org>, Andrew Morton <akpm-AT-zip.com.au>, Alan Cox <alan-AT-lxorguk.ukuu.org.uk>, Evgeniy Polyakov <johnpol-AT-2ka.mipt.ru>, "David S. Miller" <davem-AT-davemloft.net>, Suparna Bhattacharya <suparna-AT-in.ibm.com>, Davide Libenzi <davidel-AT-xmailserver.org>, Jens Axboe <jens.axboe-AT-oracle.com>, Thomas Gleixner <tglx-AT-linutronix.de>



On Wed, 30 May 2007, Ingo Molnar wrote:
>
> * Ulrich Drepper <drepper@redhat.com> wrote:
> > 
> > I'm not going to judge your tests but saying there are no significant 
> > advantages is too one-sided.  There is one huge advantage: the 
> > interface.  A memory-based interface is simply the best form.  File 
> > descriptors are a resource the runtime cannot transparently consume.
> 
> yeah - this is a fundamental design question for Linus i guess :-)

Well, quite frankly, to me, the most important part of syslets is that if 
they are done right, they introduce _no_ new interfaces at all that people 
actually use.

Over the years, we've done lots of nice "extended functionality" stuff. 
Nobody ever uses them. The only thing that gets used is the standard stuff 
that everybody else does too.

So when it comes to syslets, the most important interface will be the 
existing aio_read() etc interfaces _without_ any in-memory stuff at all, 
and everything done by the kernel to just make it look exactly like it 
used to look. And the biggest advantage is that it simplifies the internal 
kernel code, and makes us use the same code for aio and non-aio (and I 
think we have a good possibility of improving performance too, if only 
because we will get much more natural and fine-grained scheduling points!)

Any extended "direct syslets" use is technically _interesting_, but 
ultimately almost totally pointless. Which was why I was pushing really 
really hard for a simple interface and not being too clever or exposing 
internal designs too much. An in-memory thing tends to be the absolute 
_worst_ interface when it comes to abstraction layers and future changes.

> glibc (and other infrastructure libraries) have a fundamental problem: 
> they cannot (and do not) presently use persistent file descriptors to 
> make use of kernel functionality, due to ABI side-effects.

glibc has a more fundamental problem: the "fun" stuff is generally not 
worth it. 

For example, any AIO thing that requires glibc to be rewritten is almost 
totally uninteresting. It should work with _existing_ binaries, and 
_existing_ ABI's to be useful - since 99% of all AIO users are binary- 
only and won't recompile for some experimental library.

The whole epoll/kevent flame-wars have ignored a huge issue: almost nobody 
uses either. People still use poll and select, to such an _overwhelming_ 
degree that it almost doesn't even matter if you were to make the 
alternatives orders of magnitude faster - it wouldn't even be visible. 

> we should perhaps enable glibc to have its separate fd namespace (or 
> 'hidden' file descriptors at the upper end of the fd space) so that it 
> can transparently listen to netlink events (or do epoll), without 
> impacting the application fd namespace - instead of ducking to a memory 
> based API as a workaround.

Yeah, I don't think it would be at all wrong to have "private file 
descriptors". I'd prefer that over memory-based (for all the abstraction 
issues, and because a lot of things really *are* about file descriptors!). 

		Linus



to post comments

Re: Syslets, Threadlets, generic AIO support, v6

Posted May 31, 2007 4:00 UTC (Thu) by cventers (guest, #31465) [Link] (2 responses)

I don't know who the "nobody" Linus is referring to is - the corporate
world of software development (Oracle, et. al.)? I prefer to take
advantage of new whiz-bang interfaces when they're available, so long as I
have portable fallback code for other platforms. The exception to the rule
is when a new whiz-bang interface actually doesn't do what I need it to,
or doesn't do it in a clean way. Perhaps that's the issue with some of the
new interfaces?

Re: Syslets, Threadlets, generic AIO support, v6

Posted May 31, 2007 4:39 UTC (Thu) by JoeBuck (subscriber, #2330) [Link] (1 responses)

But if the new whiz-bang interface changes with every kernel release, you won't be able to use it effectively. Right now, unless you're a device driver writer, you get insulated from all the mess because you talk to glibc, not to the kernel.

So a new whiz-bang feature that allows glibc to implement a standard interface more efficiently gets used (even by older programs), but an oddball feature that exists only in, say, Linux 2.6.21 and later and needs to be programmed in a special way, is going to get used much more rarely.

Re: Syslets, Threadlets, generic AIO support, v6

Posted May 31, 2007 14:09 UTC (Thu) by Azazel (subscriber, #3724) [Link]

There's also the matter of portability. My company's middleware uses epoll on Linux (and /dev/poll on Solaris), but those are the only platforms we support, so it's not that much of a problem. If one wants something that Just Works on any POSIX system, then it's poll or select.


Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds