public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fastboot: keep at least one thread per cpu during boot
Date: Sun, 8 Feb 2009 21:27:48 -0800	[thread overview]
Message-ID: <20090208212748.4b7569b5@infradead.org> (raw)
In-Reply-To: <20090209034826.GA4768@nowhere>

On Mon, 9 Feb 2009 04:48:27 +0100
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> Async threads are created and destroyed depending on the number of
> jobs in queue. It means that several async threads can be created for
> a specific batch of work, then the threads will die after the
> completion of this batch, but they could be needed just after this
> completion for another batch of work. During the boot, such
> repetitive thread creations can be wasteful, that's why this patch
> proposes to keep at least one thread per cpu (if they already have
> been created once). Such a threshold of threads kept alive will
> prevent from a part of the thread creation overhead. This threshold
> will be dropped one the system_state switches from SYSTEM_BOOTING to
> SYSTEM_RUNNING.

I'm not very fond of this to be honest;
at least during boot there's enough activity, and the time is so short
(that's the point of the parallel stuff!) that this will not kick in to
make a difference; specifically, every boot I've seen the number of
threads is highest near the end, and also the total kernel boot time is
below 1.5 seconds or so, not long enough for the threads to die.

Creating a thread is *CHEAP*. Really really cheap. You can do 100
thousands/second on even a modest CPU. If you have a high frequency of
events, you don't want this, sure, and that is why there is a one
second delay to give opportunity for reuse... but really....


Now, if async function calls get used more, I can see the point of
always keeping one thread alive, just for both performance and VM low
memory issues; but that's not what your patch is doing.

-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  reply	other threads:[~2009-02-09  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09  3:48 [PATCH] fastboot: keep at least one thread per cpu during boot Frederic Weisbecker
2009-02-09  5:27 ` Arjan van de Ven [this message]
2009-02-09 10:17   ` Cornelia Huck
2009-02-09 13:34   ` Frederic Weisbecker

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=20090208212748.4b7569b5@infradead.org \
    --to=arjan@infradead.org \
    --cc=cornelia.huck@de.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.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