lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 4 Jan 2009 10:40:35 -0800
From:	Arjan van de Ven <arjan@...radead.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>, fweisbec@...il.com,
	linux-scsi@...r.kernel.org, linux-ide@...r.kernel.org,
	linux-acpi@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/4] fastboot: Asynchronous function calls to speed up
 kernel boot

On Sun, 4 Jan 2009 10:33:34 -0800 (PST)
Linus Torvalds <torvalds@...ux-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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ