lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0702150757520.20368@woody.linux-foundation.org>
Date:	Thu, 15 Feb 2007 08:09:54 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Evgeniy Polyakov <johnpol@....mipt.ru>
cc:	Ingo Molnar <mingo@...e.hu>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Arjan van de Ven <arjan@...radead.org>,
	Christoph Hellwig <hch@...radead.org>,
	Andrew Morton <akpm@....com.au>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Ulrich Drepper <drepper@...hat.com>,
	Zach Brown <zach.brown@...cle.com>,
	"David S. Miller" <davem@...emloft.net>,
	Benjamin LaHaise <bcrl@...ck.org>,
	Suparna Bhattacharya <suparna@...ibm.com>,
	Davide Libenzi <davidel@...ilserver.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 05/11] syslets: core code



On Thu, 15 Feb 2007, Evgeniy Polyakov wrote:
> > 
> > In other words, the "let user space sort out the complexity" is not a good 
> > answer. It just means that the interface is badly designed.
> 
> Well, if we can setup iocb structure, why we can not setup syslet one?

(I'm cutting wildly, to try to get to the part I wanted to answer)

I actually think aio_read/write() and friends are *horrible* interfaces.

Here's a quick question: how many people have actually ever seen them used 
in "normal code"? 

Yeah. Nobody uses them. They're not all that portable (even within unixes 
they aren't always there, much less in other places), they are fairly 
obscure, and they are just not really easy to use.

Guess what? The same is going to be true *in*spades* for any Linux- 
specific async system call thing.

This is why I think simplicity of use along with transparency, is so 
important. I think "aio_read()" is already a nasty enough interface, and 
it's sure more portable than any Linux-specific extension will be (only 
until the revolution comes, of course - at that point, everybody who 
doesn't use Linux will be up against the wall, so we can solve the problem 
that way).

So a Linux-specific extension needs to be *easier* to use or at least 
understand, and have *more* obvious upsides than "aio_read()" has. 
Otherwise, it's pointless - nobody is really going to use it.

This is why I think the main goals should be:

 - the *internal* kernel goal of trying to replace some very specific 
   aio_read() etc code with somethign more maintainable.

   This is really a maintainability argument, nothing more. Even if we 
   never do anything *but* aio_read() and friends, if we can avoid having 
   the VFS code have multiple code-paths and explicit checks for AIO, and 
   instead handle it more "automatically", I think it is already worth it.

 - add extensions that people *actually*can*use* in practice.

   And this is where "simple interfaces" comes in.

> So there is no point in 'complex setup and overhead', but there is
> a. limit of the AIO (although my point is not to have huge amount of
> 	working threads - they were created by people who can not
> 	program state machines (c) Alan Cox)
> b. possibility to implement a state machine (in current form likely will
> 	not be used except maybe some optional hints for IO tasks like
> 	fadvice)
> c. in all other ways it has all pros and cons of micro-thread design (it
> 	looks neat and simple, although is utterly broken in some usage
> 	cases).

I don't think the "atom" approach is bad per se. I think it could be fine 
to have some state information in user space. It's just that I think 
complex interfaces that people largely won't even use is a big mistake. We 
should concentrate on usability first, and some excessive cleverness 
really isn't a big advantage.

Being able to do a "open + stat" looks like a fine thing. But I doubt 
you'll see a lot of other combinations.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ