From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
mingo@elte.hu, Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Subject: Re: [PATCH] fastboot: Introduce an asynchronous function call mechanism
Date: Wed, 15 Oct 2008 13:30:45 +0100 [thread overview]
Message-ID: <20081015133045.1639b72b@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20081015075246.2e1610f3@infradead.org>
> it's very simple. Take the case of doing each sata port probe as an
> asynchronous item. In order to keep a stable device naming/ordering,
> all the sata probes need to be done in sequence
Not really, you need the results to be ordered which simply means you
need a rendezvous and ordered dispatch from that point.
For ATA stability the only serialization points are handling out ataxx:
numbers and handing out device identifiers. You can find all the ports in
parallel and you can probe them all for disks in parallel (Power supply
permitting).
In fact in both those cases you could do it entirely in parallel as you
can order the probe sequence at start time. That in turn means that
you can defer assignation of names, but that might make the boot messages
a bit confusing.
I'd also question call_async as we don't have infinite thread resources
(or anywhere near sufficient) so in fact what you have is
queue_async(arguments)/complete_async_work(result). Also the async call
is exactly that so we need to be very careful people realise that and
don't pass pointers to local stack objects or we will have some truely
hellish debugging to do. In fact I suspect passing a single
'private_data' object as we do for irqs and other async event handlers is
far safer.
Implementing the queue_async_sequenced(arguments) /
complete_async_sequenced() / finalize_sequenced() model would make life a
lot easier for stuff like device probing with ordering as well.
queue_async_sequenced(sequence, call, finalize, private_data)
queue asynchronous task and if resources exist start it as call(sequence,
private_data)
complete_async_sequenced - finish this task, store result and if
possible despatch the next one
finalize_sequenced - wait for all completions in this sequence
then run the finalize method of each strictly in the order that they were
added orginally by queue_async_sequenced.
gives us exactly what is needed for stuff like SATA probe. After the
finalize the ability to restart_async_sequenced() with a new
call/finalize function would be elegant but not essential ...
Alan
next prev parent reply other threads:[~2008-10-15 12:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-12 23:44 Arjan van de Ven
2008-10-12 23:45 ` async function call test users Arjan van de Ven
2008-10-13 7:22 ` Ingo Molnar
2008-10-13 3:44 ` [PATCH] fastboot: Introduce an asynchronous function call mechanism Willy Tarreau
2008-10-13 7:15 ` Pekka Enberg
2008-10-13 14:45 ` Arjan van de Ven
2008-10-15 8:41 ` Andrew Morton
2008-10-15 10:37 ` Evgeniy Polyakov
2008-10-15 11:52 ` Arjan van de Ven
2008-10-15 12:30 ` Alan Cox [this message]
2008-10-15 16:59 ` Andrew Morton
2008-10-15 17:52 ` Alexey Dobriyan
2008-10-15 17:55 ` Roland Dreier
2008-10-15 18:09 ` Alexey Dobriyan
2008-10-15 18:09 ` Andrew Morton
2008-10-15 20:23 ` Arjan van de Ven
2008-10-15 21:18 ` Evgeniy Polyakov
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=20081015133045.1639b72b@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®