[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6f703f960702051331v3ceab725h68aea4cd77617f84@mail.gmail.com>
Date: Mon, 5 Feb 2007 12:31:35 -0900
From: "Kent Overstreet" <kent.overstreet@...il.com>
To: "Davide Libenzi" <davidel@...ilserver.org>
Cc: "Linus Torvalds" <torvalds@...ux-foundation.org>,
"Zach Brown" <zach.brown@...cle.com>,
"Ingo Molnar" <mingo@...e.hu>,
"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
linux-aio@...ck.org, "Suparna Bhattacharya" <suparna@...ibm.com>,
"Benjamin LaHaise" <bcrl@...ck.org>
Subject: Re: [PATCH 2 of 4] Introduce i386 fibril scheduling
> > 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);
Then you just have your async_getevents return the same pointers you
passed in, and your main event loop gets pointers to its threads for
free.
It seems cleaner to do it this way vs. returning structs with the
actual return code and a cookie, as threads get the return code
exactly where they want it.
Keep in mind that the epoll way (while great for epoll, I do love it)
makes sense because it doesn't have to deal with any sort of return
codes.
My only other point is that you really do want a bulk asys_submit
instead of doing a syscall per async syscall; one of the great wins of
this approach is heavily IO driven apps can batch up syscalls.
-
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