public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC][PATCH] create workqueue threads only when needed
Date: Mon, 2 Feb 2009 03:24:15 +0100	[thread overview]
Message-ID: <20090202022414.GA5006@nowhere> (raw)
In-Reply-To: <1233524261.18767.60.camel@pasglop>

On Mon, Feb 02, 2009 at 08:37:41AM +1100, Benjamin Herrenschmidt wrote:
> 
> > I don't know, most of those I've looked on are not documented about the reason
> > for a private workqueue. I guess most of them can use the usual kevent.
> 
> The main problem with kevent is that it gets clogged up.


I don't think so. Here is a snapshot of the workqueue tracer in my
box currently:

# CPU  INSERTED  EXECUTED   NAME
# |      |         |          |

  1      0          0       hda0/1
  1    589        589       reiserfs/1
  1      0          0       scsi_tgtd/1
  1      0          0       aio/1
  1      0          0       ata/1
  1    378        378       kblockd/1
  1      0          0       kintegrityd/1
  1      2          2       work_on_cpu/1
  1   8706       8706       events/1

  0  19994      19994       cqueue
  0      0          0       hda0/0
  0    501        501       reiserfs/0
  0      0          0       scsi_tgtd/0
  0      0          0       aio/0
  0      0          0       ata_aux
  0      0          0       ata/0
  0      4          4       kacpi_notify
  0     22         22       kacpid
  0    379        379       kblockd/0
  0      0          0       kintegrityd/0
  0   1056       1056       khelper
  0     15         15       work_on_cpu/0
  0   9367       9367       events/0
  0      0          0       cpuset

And the result of uptime:

 02:51:40 up  2:22,  6 users,  load average: 0.22, 0.34, 0.59

So I have a total of 18073 works sent and performed by kevent for
10300 seconds.

An average of a bit less than 2 works on kevents per seconds is not about something
clogged, especially since we are talking about small jobs, usually those which play
the role of bottom halves and would have fit in a tasklet/softirq by the past.

Now if you look at the other workqueues.
Most of them don't do anything (more likely I don't do anything with them).

Khelper can't be replaced since it performs slow works which may wait for userspace
processes completion although I'm not sure it's still useful after the boot.

cqueue is usually inactive but I raised a good number of events artificially on it, I
just sent a patch to create its workqueue only when needed.

And for the others, I don't know yet.

 
> That's were thread pools kick in ... tried using Dave Howells slow
> work ?


I think it can be useful, as an example the kpsmoused workqueue receive rare
and slow works of mouse resynchronisation.
I wanted to convert it into a slow work created only on the fly.

But..I don't find it. I've seen some patches about it but it doesn't seem
to be merged.
So I tried something else for kpsmoused: turn it into a thread created on the fly.

But I think these slow works could be useful for such things.


> Cheers,
> Ben.
> 
> 


  reply	other threads:[~2009-02-02  2:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27  0:17 [RFC][PATCH] create workqueue threads only when needed Frederic Weisbecker
2009-01-27  0:30 ` Arjan van de Ven
2009-01-31 18:03   ` Frederic Weisbecker
2009-01-31 18:15     ` Arjan van de Ven
2009-01-31 18:28       ` Frederic Weisbecker
2009-02-01 16:22         ` Stefan Richter
2009-02-01 17:04           ` Arjan van de Ven
2009-02-01 17:40             ` Stefan Richter
2009-02-01 17:47               ` Arjan van de Ven
2009-02-01 18:06                 ` Stefan Richter
2009-02-01 18:11                   ` Arjan van de Ven
2009-02-01 21:37         ` Benjamin Herrenschmidt
2009-02-02  2:24           ` Frederic Weisbecker [this message]
2009-02-02  6:00             ` Benjamin Herrenschmidt
2009-02-02  8:42               ` Stefan Richter
2009-02-02  9:05                 ` Benjamin Herrenschmidt
2009-02-02  9:14                   ` Oliver Neukum
2009-02-02  9:46                     ` Benjamin Herrenschmidt
2009-02-02  9:58                       ` Peter Zijlstra
2009-02-02 10:03                       ` Oliver Neukum
2009-02-02 20:44                         ` Benjamin Herrenschmidt
2009-02-04  9:54                           ` Oliver Neukum
2009-02-02 11:39                     ` Stefan Richter
2009-02-02 11:32                 ` Frederic Weisbecker
2009-02-02 11:26               ` Frederic Weisbecker
2009-02-02  5:19           ` Arjan van de Ven
2009-02-02  6:01             ` Benjamin Herrenschmidt
2009-02-02  9:01             ` Stefan Richter
2009-02-02 14:45               ` Arjan van de Ven
     [not found] ` <20090126162807.1131c777.akpm@linux-foundation.org>
2009-01-27  1:46   ` Oleg Nesterov
2009-01-27  8:40     ` Frederic Weisbecker
2009-01-27  3:07 ` Alasdair G Kergon
2009-01-27  8:57   ` Frederic Weisbecker
2009-01-27 12:43     ` Ingo Molnar
2009-02-02 14:49 ` Daniel Walker
2009-02-02 14:51   ` Frédéric Weisbecker
2009-02-02 15:40     ` Daniel Walker

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=20090202022414.GA5006@nowhere \
    --to=fweisbec@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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