mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org
Subject: Re: mmotm 2009-04-10-02-21 uploaded - forkbombed by work_for_cpu
Date: Sat, 11 Apr 2009 09:22:06 -0400	[thread overview]
Message-ID: <4609.1239456126@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Fri, 10 Apr 2009 02:22:23 PDT." <200904100922.n3A9MOIV013828@imap1.linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 2204 bytes --]

On Fri, 10 Apr 2009 02:22:23 PDT, akpm@linux-foundation.org said:
> The mm-of-the-moment snapshot 2009-04-10-02-21 has been uploaded to
> 
>    http://userweb.kernel.org/~akpm/mmotm/

My system is reporting 70-90 forks per second, 'lastcomm' is reporting:

work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37
work_for_cpu      F    root     ??         0.00 secs Sat Apr 11 08:37

(and about 100K more of same).

Reverting this commit made the forks go away:

commit 6b44003e5ca66a3fffeb5bc90f40ada2c4340896
Author: Andrew Morton <akpm@linux-foundation.org>
Date:   Thu Apr 9 09:50:37 2009 -0600

    work_on_cpu(): rewrite it to create a kernel thread on demand

No, I don't see why this generated a user-visible fork and accounting
record to be cut.  Maybe that's a normal side effect of kthread_create()
that I've never noticed because kthreads rarely exit, especially not at
90/sec.  I also don't know who's *calling* work_on_cpu() 90 times a
second, but I suspect it's this:

    This is not terribly fast, but the only current caller of work_on_cpu() is
    pci_call_probe().

Umm. No.

% find . -name '*.c' | xargs grep -l work_on_cpu 2> /dev/null 
./arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
./arch/x86/kernel/microcode_core.c
./arch/x86/kernel/acpi/cstate.c
./arch/x86/kernel/apm_32.c
./kernel/workqueue.c
./drivers/acpi/processor_throttling.c
./drivers/pci/pci-driver.c

Probable cause for my problem:

arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c calls work_on_cpu(). We get into a
state where we have enough activity to kick us to a high CPU speed, and then
the activity of writing 90 acct records per sec keeps us there - with continual
callbacks to see if we can drop the CPU speed.


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

  parent reply	other threads:[~2009-04-13 15:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200904100922.n3A9MOIV013828@imap1.linux-foundation.org>
2009-04-10 19:53 ` mmotm 2009-04-10-02-21 uploaded (shmem) Randy Dunlap
2009-04-10 20:00   ` Andrew Morton
2009-04-10 20:04     ` Randy Dunlap
2009-04-10 20:16     ` Hugh Dickins
2009-04-11 13:22 ` Valdis.Kletnieks [this message]
2009-04-13 16:04   ` mmotm 2009-04-10-02-21 uploaded - forkbombed by work_for_cpu Linus Torvalds
2009-04-13 16:34     ` Mike Galbraith
2009-04-13 17:18     ` Ingo Molnar
2009-04-13 17:27       ` Andrew Morton
2009-04-13 17:41         ` Ingo Molnar
2009-04-13 17:45         ` Linus Torvalds
2009-04-13 18:11           ` Ingo Molnar
2009-04-13 18:49           ` Andrew Morton
2009-04-13 19:03             ` Jeremy Fitzhardinge
2009-04-13 19:03             ` Dave Jones
2009-04-13 19:40               ` Ingo Molnar
2009-04-13 19:27         ` Valdis.Kletnieks
2009-04-13 23:50         ` Linus Torvalds
2009-04-14  0:31           ` Andrew Morton
2009-04-15  8:15         ` Ali Gholami Rudi
2009-04-15  8:34           ` Andrew Morton
2009-04-15  9:08             ` Ali Gholami Rudi
2009-04-15 14:45             ` Linus Torvalds
2009-04-14 12:42     ` Rusty Russell

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=4609.1239456126@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®