public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Jones <davej@redhat.com>, Robin Holt <holt@sgi.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Jack Steiner <steiner@americas.sgi.com>
Subject: Re: init's children list is long and slows reaping children.
Date: Tue, 10 Apr 2007 03:05:56 -0400	[thread overview]
Message-ID: <461B3754.9040107@garzik.org> (raw)
In-Reply-To: <20070409193056.6b52c354.akpm@linux-foundation.org>

Andrew Morton wrote:
> : root         3  0.0  0.0      0     0 ?        S    18:51   0:00 [watchdog/0]
> 
> That's the softlockup detector.  Confusingly named to look like a, err,
> watchdog.  Could probably use keventd.

I would think this would run into the keventd "problem", where $N 
processes can lock out another?

IMO a lot of these could potentially be simply started as brand new 
threads, when an exception arises.


> : root         5  0.0  0.0      0     0 ?        S    18:51   0:00 [khelper]
> 
> That's there to parent the kthread_create()d threads.  Could presumably use
> khelper.
> 
> : root       152  0.0  0.0      0     0 ?        S    18:51   0:00 [ata/0]
> 
> Does it need to be per-cpu?

No, it does not.

It is used for PIO data transfer, so it merely has to respond quickly, 
which rules out keventd.  You also don't want PIO data xfer for port A 
blocked, sitting around waiting for PIO data xfer to complete on port C.

So, we merely need fast-reacting threads that keventd will not block. 
We do not need per-CPU threads.

Again, I think a model where threads are created on demand, and reaped 
after inactivity, would fit here.  As I feel it would fit with many 
other non-libata drivers.


> : root       153  0.0  0.0      0     0 ?        S    18:51   0:00 [ata_aux]
> 
> That's a single-threaded workqueue handler.  Perhaps could use keventd.

That is used by libata exception handler, for hotpug and such.  My main 
worry with keventd is that we might get stuck behind an unrelated 
process for an undefined length of time.

IMO the best model would be to create ata_aux thread on demand, and kill 
it if it hasn't been used recently.



> : root       299  0.0  0.0      0     0 ?        S    18:51   0:00 [scsi_eh_0]
> : root       300  0.0  0.0      0     0 ?        S    18:51   0:00 [scsi_eh_1]
> : root       305  0.0  0.0      0     0 ?        S    18:51   0:00 [scsi_eh_2]
> : root       306  0.0  0.0      0     0 ?        S    18:51   0:00 [scsi_eh_3]
> 
> This machine has one CPU, one sata disk and one DVD drive.  The above is
> hard to explain.

Nod.  I've never thought we needed this many threads.  At least it 
doesn't scale out of control for $BigNum-CPU boxen.

As the name implies, this is SCSI exception handling thread.  Although 
some synchronization is required, this could probably work with an 
on-demand thread creation model too.


> : root       319  0.0  0.0      0     0 ?        S    18:51   0:00 [pccardd]
> 
> hm.
> 
> : root       331  0.0  0.0      0     0 ?        S    18:51   0:00 [kpsmoused]
> 
> hm.

This kernel thread is used as a "bottom half" handler for the PS2 mouse 
interrupt.  This one is a bit more justifiable.


> : root       337  0.0  0.0      0     0 ?        S    18:51   0:00 [kedac]
> 
> hm.  I didn't know that the Vaio had EDAC.
> 
> : root      1173  0.0  0.0      0     0 ?        S    18:51   0:00 [khpsbpkt]
> 
> I can't even pronounce that.
> 
> : root      1354  0.0  0.0      0     0 ?        S    18:51   0:00 [knodemgrd_0]
> 
> OK, I do have 1394 hardware, but it hasn't been used.
> 
> : root      1636  0.0  0.0      0     0 ?        S    18:52   0:00 [kondemand/0]
> 
> I blame davej.
> 
>>  > otoh, a lot of these inefficeincies are probably down in scruffy drivers
>>  > rather than in core or top-level code.
>>
>> You say scruffy, but most of the proliferation of kthreads comes
>> from code written in the last few years.  Compare the explosion of kthreads
>> we see coming from 2.4 to 2.6. It's disturbing, and I don't see it
>> slowing down at all.
>>
>> On the 2-way box I grabbed the above ps output from, I end up with 69 kthreads.
>> It doesn't surprise me at all that bigger iron is starting to see issues.
>>
> 
> Sure.
> 
> I don't think it's completely silly to object to all this.  Sure, a kernel
> thread is worth 4k in the best case, but I bet they have associated unused
> resources and as we've seen, they can cause overhead.

Agreed.

	Jeff



  parent reply	other threads:[~2007-04-10  7:06 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 19:51 init's children list is long and slows reaping children Robin Holt
2007-04-05 20:57 ` Linus Torvalds
2007-04-06  0:51   ` Chris Snook
2007-04-06  1:03     ` Chris Snook
2007-04-06  1:29     ` Linus Torvalds
2007-04-06  2:15       ` Eric W. Biederman
2007-04-06 10:43         ` Robin Holt
2007-04-06 15:38           ` Eric W. Biederman
2007-04-06 16:31             ` Oleg Nesterov
2007-04-06 17:32               ` Ingo Molnar
2007-04-06 17:39                 ` Roland Dreier
2007-04-06 18:04                   ` Eric W. Biederman
2007-04-06 18:30                 ` Eric W. Biederman
2007-04-06 19:18                   ` [patch] sched: get rid of p->children use in show_task() Ingo Molnar
2007-04-06 19:22                     ` Ingo Molnar
2007-04-10 13:48                   ` init's children list is long and slows reaping children Ingo Molnar
2007-04-10 13:38                     ` Oleg Nesterov
2007-04-10 15:00                       ` Eric W. Biederman
2007-04-10 15:16                       ` [PATCH] Only send pdeath_signal when getppid changes Eric W. Biederman
2007-04-10 16:37                         ` Oleg Nesterov
2007-04-10 17:41                           ` Eric W. Biederman
2007-04-10 17:48                             ` Roland McGrath
2007-04-11  3:17                               ` Albert Cahalan
2007-04-10 14:51                     ` init's children list is long and slows reaping children Eric W. Biederman
2007-04-10 15:06                       ` Ingo Molnar
2007-04-10 15:22                         ` Eric W. Biederman
2007-04-10 15:53                           ` Ingo Molnar
2007-04-10 16:17                             ` Eric W. Biederman
2007-04-11  6:20                             ` [patch] uninline remove/add_parent() APIs Ingo Molnar
2007-04-11  7:00                               ` Eric W. Biederman
2007-04-11 22:06                                 ` Andrew Morton
2007-04-12 10:45                                   ` Eric W. Biederman
2007-04-12 22:50                                   ` Roland McGrath
2007-04-10 16:44                       ` init's children list is long and slows reaping children Oleg Nesterov
2007-04-11 19:55                         ` Bill Davidsen
2007-04-11 20:17                           ` Eric W. Biederman
2007-04-11 21:24                             ` Bill Davidsen
2007-04-11 20:19                           ` Oleg Nesterov
2007-04-06 18:02               ` Eric W. Biederman
2007-04-06 18:21               ` Davide Libenzi
2007-04-06 18:56                 ` Eric W. Biederman
2007-04-06 19:16                   ` Davide Libenzi
2007-04-06 19:19                     ` Ingo Molnar
2007-04-06 21:29                       ` Davide Libenzi
2007-04-06 21:51                         ` Linus Torvalds
2007-04-06 22:31                           ` Davide Libenzi
2007-04-06 22:46                             ` Linus Torvalds
2007-04-06 22:59                               ` Davide Libenzi
2007-04-09  8:28                           ` Ingo Molnar
2007-04-09 18:09                             ` Bill Davidsen
2007-04-09 19:28                               ` Kyle Moffett
2007-04-09 19:51                                 ` Linus Torvalds
2007-04-09 20:03                                   ` Davide Libenzi
2007-04-10 15:12                                     ` Bill Davidsen
2007-04-10 19:17                                       ` Davide Libenzi
2007-04-09 20:00                                 ` Eric W. Biederman
2007-04-06 16:41             ` Robin Holt
2007-04-09 17:37         ` Chris Snook
2007-04-06 18:05       ` Christoph Hellwig
2007-04-06 19:39         ` Eric W. Biederman
2007-04-06 22:38 ` Jeff Garzik
2007-04-06 22:51   ` Linus Torvalds
2007-04-06 23:37     ` Jeff Garzik
2007-04-11  7:28       ` Nick Piggin
2007-04-10  0:23   ` Andrew Morton
2007-04-10  0:48     ` Eric W. Biederman
2007-04-10  1:15       ` Andrew Morton
2007-04-10  6:53       ` Jeff Garzik
2007-04-10  9:42       ` Robin Holt
2007-04-10  1:59     ` Dave Jones
2007-04-10  2:30       ` Andrew Morton
2007-04-10  2:46         ` Linus Torvalds
2007-04-10  7:07           ` Jeff Garzik
2007-04-10 22:20             ` Ingo Oeser
2007-04-10  5:07         ` Alexey Dobriyan
2007-04-10  5:21           ` Dave Jones
2007-04-10  6:09         ` Torsten Kaiser
2007-04-10  7:08           ` Jeff Garzik
2007-04-10  7:05         ` Jeff Garzik [this message]
2007-04-10  7:37           ` Andrew Morton
2007-04-10  8:33             ` Jeff Garzik
2007-04-10  8:41               ` Andrew Morton
2007-04-10  8:48                 ` Jeff Garzik
2007-04-10 22:35                   ` Ingo Oeser
2007-04-10 16:35           ` Matt Mackall
2007-04-10  7:44         ` Russell King
2007-04-10  8:16           ` Jeff Garzik
2007-04-10  8:59           ` Ingo Molnar
2007-04-10  9:33             ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-04-06  8:42 Oleg Nesterov
2007-04-06  9:10 ` Eric W. Biederman
2007-04-06  9:44   ` Oleg Nesterov
2007-04-06 15:45     ` Eric W. Biederman
2007-04-06 15:47       ` Oleg Nesterov
2007-04-06 17:16         ` Linus Torvalds
2007-04-06 17:27           ` Ingo Molnar
2007-04-06 17:31             ` Ingo Molnar
2007-04-06 17:34           ` Eric W. Biederman
2007-04-06 19:06             ` H. Peter Anvin
2007-04-06 19:15               ` Eric W. Biederman
2007-04-06 19:21                 ` H. Peter Anvin
2007-04-06 21:04                 ` Jeremy Fitzhardinge
2007-04-06 21:07                   ` H. Peter Anvin
2007-04-06 19:36           ` Oleg Nesterov
2007-04-06 19:43             ` Ingo Molnar
2007-04-06 20:01               ` Oleg Nesterov
2007-04-06 20:21                 ` Ingo Molnar
2007-04-06 19:47             ` Oleg Nesterov
2007-04-06 19:59               ` Eric W. Biederman
2007-04-07 20:31             ` Oleg Nesterov
2007-04-08  0:38               ` Eric W. Biederman
2007-04-08 15:46                 ` Oleg Nesterov

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=461B3754.9040107@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=holt@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=steiner@americas.sgi.com \
    --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