public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: arjan@infradead.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] kernel:async function call:introduce async_run
Date: Wed, 13 May 2009 15:31:01 +0200	[thread overview]
Message-ID: <20090513153101.3bceb04c@gondolin> (raw)
In-Reply-To: <d82e647a0905130556y50620617i8c5ac597b6207406@mail.gmail.com>

On Wed, 13 May 2009 20:56:40 +0800,
Ming Lei <tom.leiming@gmail.com> wrote:

> 2009/5/13 Cornelia Huck <cornelia.huck@de.ibm.com>:
> > On Wed, 13 May 2009 08:33:49 +0800,
> > tom.leiming@gmail.com wrote:

> >>  /**
> >> + * async_run - schedule a function for asynchronous execution
> >> + * @ptr: function to execute asynchronously
> >> + * @data: data pointer to pass to the function
> >> + *
> >> + * Note:we do not allocate a cookie for this kind of aysnchronous
> >> + * function to decrease the wait time of async_synchronize_full().
> >
> > But async_synchronize_full() still waits for list_empty(&async_running)
> > - so what does this buy us?
> 
> I mean it can decrease the wait time for other async function.
> async_schedule() still can be used to do such thing, but may lead to a
> slower boot.  It is the main
> purpose of the patch.

I see how this can affect places calling async_synchronize_cookie(),
but the function will still end up on async_running. If you don't want
async_synchronize_full() waiting for these functions, couldn't you use
your own running list?

(Oh, and I just thought about it a bit further:
- somebody calls async_run() -> function with cookie = MAX_COOKIE will be
  lowest_in_progress at some point in time
- somebody else calls async_schedule() -> cookie = n
- we wait with async_synchronize_cookie(n) - which returns since
  MAX_COOKIE >= n, which is probably not what we want)

  reply	other threads:[~2009-05-13 13:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  0:33 [PATCH] kernel:async function call:introduce async_run tom.leiming
2009-05-13 11:02 ` Cornelia Huck
2009-05-13 12:56   ` Ming Lei
2009-05-13 13:31     ` Cornelia Huck [this message]
2009-05-13 14:27       ` Ming Lei
2009-05-17 20:58 ` Arjan van de Ven

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=20090513153101.3bceb04c@gondolin \
    --to=cornelia.huck@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    /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