public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org
Subject: Re: [PATCH 1/7] async: Asynchronous function calls to speed up kernel boot
Date: Mon, 16 Feb 2009 11:31:26 +0100	[thread overview]
Message-ID: <20090216113126.3e54863a@gondolin> (raw)
In-Reply-To: <20090215111636.5b6cc507@infradead.org>

On Sun, 15 Feb 2009 11:16:36 -0800,
Arjan van de Ven <arjan@infradead.org> wrote:

> * The caller needs to provide the memory
>    - solves the case of the internal implementation getting a failed
>      allocation. BUT it does not solve the caller not getting memory,
>      it shifts the complexity to there.
>    - ... or needs to cope with the call potentially failing if it
>      lets the infrastructure to do the allocation

We could provide a small wrapper that allocates memory for the simple
case - but having the caller provide the memory makes it more flexible.

> * The caller needs to wait (at some point) for the operation to
>   complete, and then take care of freeing the memory.
>   (the memory obviously could be part of some natural structure that
>    already has its own lifecycle rules)

So it's not so much freeing as giving up a reference.

> * There must be enough worker threads such that deadlocks due to all
>   threads waiting on each other will not happen. Practically this
>   probably means that if there is no progress, we need to just swallow
>   the pill and make more threads. In addition we can borrow the thread
>   context of the threads that are waiting for work to complete
>   - alternative is to have 2 (or more) classes of work with a reserved
>     thread pool for each, but I'm very not fond of this idea, because
>     then all the advantages of sharing the implementation go away again,
>     and over time we'll end up with many such classes
> * The caller is not allowed to use the same memory for scheduling
>   multiple outstanding function calls (this is fundamentally different
>   from schedule_work, which does allow this).
>   - we could make a flag that marks an item as "if the function and data
>     are the same silently allow it" but I'm not too fond of that idea,
>     it'll be fragile.

Agreed, that would be fragile. The caller should be able to take care
of it best.

> Practically: the scheduled function is not allowed to make the metadata
> memory go away. At least for those cases where we later want to wait
> for the opertation; in principle we could do away with this requirement
> if we know nobody will ever wait for the operation.

But that would artificially limit the usefulness.

> Second practical issue:
> We can have a flag in the metadata that says that the infrastructure is 
> supposed to kfree() the metadata at the end.

I tried that, but didn't like the result.

> Or we can go wild and stick
> a pointer in of the function that needs to be called to free the
> metadata.

krefs start to look attractive...

  parent reply	other threads:[~2009-02-16 10:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 23:11 [PATCH 0/7] V3 of the async function call patches Arjan van de Ven
2009-01-07 23:12 ` [PATCH 1/7] async: Asynchronous function calls to speed up kernel boot Arjan van de Ven
2009-01-08  0:31   ` Arnaldo Carvalho de Melo
2009-01-08  1:17     ` Arjan van de Ven
2009-01-13 20:48   ` Jonathan Corbet
2009-01-14 11:34     ` Cornelia Huck
2009-02-14  0:22   ` Andrew Morton
2009-02-14  4:59     ` Arjan van de Ven
2009-02-14  7:29       ` Andrew Morton
2009-02-15 19:16         ` Arjan van de Ven
2009-02-15 22:19           ` Arjan van de Ven
2009-02-16 10:31           ` Cornelia Huck [this message]
2009-01-07 23:12 ` [PATCH 2/7] fastboot: make scsi probes asynchronous Arjan van de Ven
2009-01-07 23:13 ` [PATCH 3/7] fastboot: make the libata port scan asynchronous Arjan van de Ven
2009-01-07 23:13 ` [PATCH 4/7] fastboot: Make libata initialization even more async Arjan van de Ven
2009-01-07 23:14 ` [PATCH 5/7] async: make the final inode deletion an asynchronous event Arjan van de Ven
2009-01-07 23:14 ` [PATCH 6/7] bootchart: improve output based on Dave Jones' feedback Arjan van de Ven
2009-01-07 23:15 ` [PATCH 7/7] async: don't do the initcall stuff post boot Arjan van de Ven
2009-01-08  0:17 ` [PATCH 0/7] V3 of the async function call patches Linus Torvalds
2009-01-08  1:21   ` Arjan van de Ven
2009-01-15  8:10     ` Pavel Machek
2009-01-09 20:21 ` Ryan Hope

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=20090216113126.3e54863a@gondolin \
    --to=cornelia.huck@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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