From: Arjan van de Ven <arjan@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>,
fweisbec@gmail.com, linux-scsi@vger.kernel.org,
linux-ide@vger.kernel.org, linux-acpi@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/4] fastboot: Asynchronous function calls to speed up kernel boot
Date: Sun, 4 Jan 2009 10:40:35 -0800 [thread overview]
Message-ID: <20090104104035.43028d8e@infradead.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0901041024360.3179@localhost.localdomain>
On Sun, 4 Jan 2009 10:33:34 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>
> On Sun, 4 Jan 2009, Arjan van de Ven wrote:
> > +
> > +typedef u64 async_cookie_t;
> > +typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
> > +
> > +extern void async_schedule(async_func_ptr *ptr, void *data);
> > +extern void async_synchronize_full(void);
> > +extern void async_synchronize_cookie(async_cookie_t cookie);
>
> Hmm. The cookie use doesn't seem to make much sense.
>
> Why do you pass in the cookie to the async function, but don't return
> it to the caller? That seems backwards - you'd normally expect that
> it is the _caller_ that wants the cookie (to synchronise with a
> specific async call), not the callee. But now the only one who knows
> the cookie is the wrong entry - just the callee, not the caller.
in fact, either could need it.
the callee could need it when IT does a global registration (for
example to get a device number) at the end of its sequence.
We'd want that registration to happen sequential (it's basically the
equivalent of a commit/retirement of the instruction in a CPU)
the caller could need it when it wants to wait for the async function
it kicked off.
so both make total sense to me.
>
> Yes, yes, I read the explanation in the comments, and it says that
> the callee should do it to guarantee its own ordering, and your acpi
> port thing does that in order to apparently start a sequence that is
> asynchronous only wrt the synchronous code, but not wrt itself.
> That's a _very_ odd model, but whatever works. But wouldn't it still
> make sense to let the caller wait for individual events too?
>
> IOW, I'd just suggest changing the interface so that
> "async_schedule()" also returns the cookie.
I had that originally... (as I described in the first mail).. but had
no users of it in the places I converted.
I'm happy to just return it; it does make sense (that's why I did this
originally)....
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2009-01-04 18:40 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-04 17:24 [PATCH 0/4] Fastboot revisited: Asynchronous function calls Arjan van de Ven
2009-01-04 17:28 ` [PATCH 1/4] fastboot: Asynchronous function calls to speed up kernel boot Arjan van de Ven
2009-01-04 18:33 ` Linus Torvalds
2009-01-04 18:40 ` Arjan van de Ven [this message]
2009-01-04 18:49 ` Arjan van de Ven
2009-01-04 19:05 ` Andi Kleen
2009-01-04 19:09 ` Arjan van de Ven
2009-01-04 19:49 ` Andi Kleen
2009-01-04 19:52 ` Andrew Morton
2009-01-04 17:29 ` [PATCH 2/4] fastboot: make scsi probes asynchronous Arjan van de Ven
2009-01-04 18:05 ` Matthew Wilcox
2009-01-04 18:13 ` Arjan van de Ven
2009-01-04 18:38 ` Jaswinder Singh Rajput
2009-01-04 18:44 ` Arjan van de Ven
2009-01-04 17:30 ` [PATCH 3/4] fastboot: make the libata port scan asynchronous Arjan van de Ven
2009-01-04 17:31 ` [PATCH 4/4] fastboot: make ACPI bus drivers probe asynchronous Arjan van de Ven
2009-01-05 2:03 ` Zhao Yakui
2009-01-05 1:58 ` Arjan van de Ven
2009-01-05 2:51 ` Zhao Yakui
2009-01-05 2:51 ` Arjan van de Ven
2009-01-05 5:30 ` Zhao Yakui
2009-01-04 18:16 ` [PATCH 0/4] Fastboot revisited: Asynchronous function calls Linus Torvalds
2009-01-04 18:31 ` Arjan van de Ven
2009-01-04 18:54 ` Linus Torvalds
2009-01-04 19:05 ` Arjan van de Ven
2009-01-04 19:11 ` Linus Torvalds
2009-01-04 19:19 ` Arjan van de Ven
2009-01-05 16:21 ` Alan Cox
2009-01-05 21:13 ` Arjan van de Ven
2009-01-05 21:21 ` Linus Torvalds
2009-01-04 19:11 ` Andi Kleen
2009-01-04 19:46 ` Robert Hancock
2009-01-04 19:27 ` Linus Torvalds
2009-01-04 19:48 ` Arjan van de Ven
2009-01-04 21:44 ` Alan Cox
2009-01-11 13:14 ` Pavel Machek
2009-01-05 6:01 ` Nigel Cunningham
2009-01-05 8:47 ` Frederic Weisbecker
2009-01-05 10:53 ` Arjan van de Ven
2009-01-05 11:18 ` Nigel Cunningham
2009-01-07 2:41 ` Shaohua Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090104104035.43028d8e@infradead.org \
--to=arjan@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).