Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161337AbXBOVRS (ORCPT ); Thu, 15 Feb 2007 16:17:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161341AbXBOVRS (ORCPT ); Thu, 15 Feb 2007 16:17:18 -0500 Received: from x35.xmailserver.org ([64.71.152.41]:1175 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161337AbXBOVRR (ORCPT ); Thu, 15 Feb 2007 16:17:17 -0500 X-AuthUser: davidel@xmailserver.org Date: Thu, 15 Feb 2007 13:17:14 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Linus Torvalds cc: Evgeniy Polyakov , Ingo Molnar , Linux Kernel Mailing List , Arjan van de Ven , Christoph Hellwig , Andrew Morton , Alan Cox , Ulrich Drepper , Zach Brown , "David S. Miller" , Benjamin LaHaise , Suparna Bhattacharya , Thomas Gleixner Subject: Re: [patch 05/11] syslets: core code In-Reply-To: Message-ID: References: <20070213142035.GF638@elte.hu> <20070215133550.GA29274@2ka.mipt.ru> <20070215163704.GA32609@2ka.mipt.ru> <20070215181059.GC20997@2ka.mipt.ru> <20070215190413.GA23953@2ka.mipt.ru> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2091 Lines: 66 On Thu, 15 Feb 2007, Linus Torvalds wrote: > > > On Thu, 15 Feb 2007, Linus Torvalds wrote: > > > > So I think that a good implementation just does everything up-front, and > > doesn't _need_ a user buffer that is live over longer periods, except for > > the actual results. Exactly because the whole alloc/teardown is nasty. > > Btw, this doesn't necessarily mean "not supporting multiple atoms at all". > > I think the batching of async things is potentially a great idea. I think > it's quite workable for "open+fstat" kind of things, and I agree that it > can solve other things too (the "socket+bind+connect+sendmsg+rcv" kind of > complex setup things). If you *really* want to allow chains (note that the above could be prolly be hosted on a real thread, once chains becomes that long), then try to build that chain with the current API, and compare it with: long my_clet(ctx *c) { int fd, error = -1; if ((fd = socket(...)) == -1 || bind(fd, &c->laddr, sizeof(c->laddr)) || connect(fd, &c->saddr, sizeof(c->saddr)) || sendmsg(fd, ...) == -1 || recv(fd, ...) <= 0) goto error = 0; erxit: close(fd); return error; } Points: - Keep the submission API to submit one or an array of parallel async syscalls/clets - Keep arguments of the syscall being longs (no need for extra pointer indirection compat code, and special copy_atoms functions) - No need for the "next" atom pointer chaining (nice for compat too) - No need to create special conditions/jump interpreters into the kernel (nice for compat and emulators). C->machine-code that that for us - Easier to code. Try to build a chain like that with the current API and you will see what I saying - Did I say faster? Machine code is faster than sudo-VM interpretation of jumps/conditions done inside the kernel - Davide - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/