Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751753AbXBFUZN (ORCPT ); Tue, 6 Feb 2007 15:25:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751938AbXBFUZN (ORCPT ); Tue, 6 Feb 2007 15:25:13 -0500 Received: from x35.xmailserver.org ([64.71.152.41]:1128 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751753AbXBFUZL (ORCPT ); Tue, 6 Feb 2007 15:25:11 -0500 X-AuthUser: davidel@xmailserver.org Date: Tue, 6 Feb 2007 12:25:00 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Kent Overstreet cc: Linus Torvalds , Zach Brown , Ingo Molnar , Linux Kernel Mailing List , linux-aio@kvack.org, Suparna Bhattacharya , Benjamin LaHaise Subject: Re: [PATCH 2 of 4] Introduce i386 fibril scheduling In-Reply-To: <6f703f960702051331v3ceab725h68aea4cd77617f84@mail.gmail.com> Message-ID: References: <20070202235531.GA18904@elte.hu> <20070203082308.GA6748@elte.hu> <8CF4BE18-8EEF-4ACA-A4B4-B627ED3B4831@oracle.com> <6f703f960702051331v3ceab725h68aea4cd77617f84@mail.gmail.com> 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: 1688 Lines: 47 On Mon, 5 Feb 2007, Kent Overstreet wrote: > > > HOWEVER, they get returned differently. The cookie gets returned > > > immediately, the system call result gets returned in-memory only after the > > > async thing has actually completed. > > > > > > I would actually argue that it's not the kernel that should generate any > > > cookie, but that user-space should *pass*in* the cookie it wants to, and > > > the kernel should consider it a pointer to a 64-bit entity which is the > > > return code. > > > > Yes. Let's have the userspace to "mark" the async operation. IMO the > > cookie should be something transparent to the kernel. > > Like you said though, that'd require compat-code (unless we fix the size). > > You don't need an explicit cookie if you're passing in a pointer to > the return code, it doesn't really save you anything to do so. Say > you've got a bunch of user threads (with or without stacks, it doesn't > matter). > > struct asys_ret { > int ret; > struct thread *p; > }; > > struct asys_ret r; > r.p = me; > > async_read(fd, buf, nbytes, &r); Hmm, are you working for Symbian? Because that's exactly how they track pending async operations (address of a status variable - wrapped in a class of course, being them) ;) That's another way of doing it, IMO no better no worse than letting explicit cookie selection from userspace. You still have to have the compat code though, either ways. - 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/