linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Holt <holt@sgi.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Robin Holt <holt@sgi.com>, Russ Anderson <rja@sgi.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH] Do not force shutdown/reboot to boot cpu.
Date: Wed, 10 Apr 2013 14:00:03 -0500	[thread overview]
Message-ID: <20130410190003.GH3658@sgi.com> (raw)
In-Reply-To: <20130410175519.GG3658@sgi.com>

> > I'm proposing to make 'reboot' overhead profilable, via a debug hack:
> > 
> >         echo 1 > /proc/sys/kernel/magic_dont_fully_reboot_flag
> > 
> > 	perf record reboot
> > 
> > perf is using NMIs to profile - and since much of cpu_down() is with irqs 
> > disabled, NMI profiling would be needed to see inside the overhead.
> > 
> > (Assuming the 240 msecs is CPU overhead, not waiting for some IRQ/IPI event.)


I had the machine booted as 512 cpus.
I tweaked the kernel like this:

diff --git a/kernel/sys.c b/kernel/sys.c
index 39c9c4a..b42bd4f 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -368,8 +368,10 @@ EXPORT_SYMBOL(unregister_reboot_notifier);
  */
 void kernel_restart(char *cmd)
 {
-       kernel_restart_prepare(cmd);
+       // kernel_restart_prepare(cmd);
        disable_nonboot_cpus();
+       enable_nonboot_cpus();
+       return;
        if (!cmd)
                printk(KERN_EMERG "Restarting system.\n");
        else

perf record -a /sbin/reboot -d -f -n

The top of 'perf report' has:
Events: 14M cycles
    22.58%          swapper  [kernel.kallsyms]           [k] update_cfs_rq_blocked_load
    10.52%          swapper  [kernel.kallsyms]           [k] load_balance
     4.96%          swapper  [kernel.kallsyms]           [k] ktime_get
     4.12%          swapper  [kernel.kallsyms]           [k] update_blocked_averages
     3.55%          swapper  [kernel.kallsyms]           [k] idle_cpu
     1.97%          swapper  [kernel.kallsyms]           [k] uv_read_rtc
     0.98%          swapper  [kernel.kallsyms]           [k] rcu_process_gp_end
     0.84%          swapper  [kernel.kallsyms]           [k] apic_timer_interrupt
     0.84%          swapper  [kernel.kallsyms]           [k] __lock_text_start
     0.84%          swapper  [kernel.kallsyms]           [k] _raw_spin_lock_irqsave
     0.73%          swapper  [kernel.kallsyms]           [k] native_safe_halt
     0.56%          swapper  [kernel.kallsyms]           [k] rcu_check_callbacks
     0.56%          swapper  [kernel.kallsyms]           [k] native_write_msr_safe
     0.44%          swapper  [kernel.kallsyms]           [k] cpumask_next_and
     0.42%           reboot  [kernel.kallsyms]           [k] kmem_cache_alloc_node

The perf data is 676 MB.  I don't know how well it compresses, but the
lzma task has been running for a while.

Thanks,
Robin

  reply	other threads:[~2013-04-10 19:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 19:37 [PATCH] Do not force shutdown/reboot to boot cpu Robin Holt
2013-04-08 15:57 ` Ingo Molnar
2013-04-08 16:11   ` H. Peter Anvin
2013-04-08 16:59     ` Robin Holt
2013-04-10 11:16       ` Ingo Molnar
2013-04-10 14:01         ` Robin Holt
2013-04-10 15:10         ` Linus Torvalds
2013-04-10 15:29           ` Russ Anderson
2013-04-10 16:59             ` Ingo Molnar
2013-04-10 17:14               ` Robin Holt
2013-04-10 17:22                 ` Ingo Molnar
2013-04-10 17:55                   ` Robin Holt
2013-04-10 19:00                     ` Robin Holt [this message]
2013-04-11  8:57                       ` Ingo Molnar
2013-04-11 11:34                         ` Robin Holt
2013-04-11 12:00                           ` Ingo Molnar
2013-04-11 12:03                             ` Robin Holt
2013-04-11 12:08                               ` Robin Holt
2013-04-11 12:14                                 ` Ingo Molnar
2013-04-10 17:58               ` H. Peter Anvin
2013-04-10 23:02               ` Russ Anderson
2013-04-10 22:29             ` Russ Anderson
2013-04-11  5:31           ` Paul Mackerras
2013-04-11 12:45             ` Bulk CPU Hotplug (Was Re: [PATCH] Do not force shutdown/reboot to boot cpu.) Srivatsa S. Bhat
2013-04-11 13:48               ` Robin Holt
2013-04-12  5:37                 ` Ingo Molnar
2013-04-12  6:09                   ` Srivatsa S. Bhat
2013-04-12  9:31                     ` Robin Holt
2013-04-12 10:01                       ` Robin Holt
2013-04-13 16:30                       ` Oleg Nesterov
2013-04-15 16:04                         ` Robin Holt
2013-04-15 16:09                           ` Oleg Nesterov
2013-04-15 16:10                           ` Robin Holt
2013-04-13 17:01                       ` Srivatsa S. Bhat
2013-04-15 10:16                       ` Ingo Molnar
2013-04-15 12:02                         ` Robin Holt
2013-04-15 15:59                           ` Robin Holt
2013-04-16  9:40                             ` Ingo Molnar
2013-04-11 14:23               ` Russ Anderson
2013-04-11 14:45                 ` Srivatsa S. Bhat
2013-04-11 20:08                   ` Russ Anderson
2013-04-11 20:17                     ` Srivatsa S. Bhat
2013-04-11 21:08                     ` Robin Holt
2013-04-08 16:54   ` [PATCH] Do not force shutdown/reboot to boot cpu Robin Holt
2013-04-08 17:07   ` Russ Anderson

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=20130410190003.GH3658@sgi.com \
    --to=holt@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rja@sgi.com \
    --cc=shawn.guo@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).