[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130410230234.GB8112@sgi.com>
Date: Wed, 10 Apr 2013 18:02:35 -0500
From: Russ Anderson <rja@....com>
To: Ingo Molnar <mingo@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Robin Holt <holt@....com>, "H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Shawn Guo <shawn.guo@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
the arch/x86 maintainers <x86@...nel.org>
Subject: Re: [PATCH] Do not force shutdown/reboot to boot cpu.
On Wed, Apr 10, 2013 at 06:59:34PM +0200, Ingo Molnar wrote:
> * Russ Anderson <rja@....com> wrote:
>
> > Yes, I have a test patch that replaces for_each_online_cpu(cpu) with a cpu
> > bitmask in disable_nonboot_cpus(). The lower level routines already take a
> > bitmask. It allows __stop_machine() to be called just once. That change
> > reduces shutdown time on a 1024 cpu machine from 16 minutes 4 minutes.
> > Significant improvement, but not good enough.
> >
> > The next significant bottleneck is __cpu_notify(). Tried creating worker
> > threads to parallelize the shutdown, but the problem is __cpu_notify() is not
> > thread safe. Putting a lock around it caused all the worker threads to fight
> > over the lock.
>
> 4 minutes bootup is 240 seconds, with 1024 CPUs that's about 240 msecs per CPU.
>
> That sounds a lot, given that unlike bootup there's not much real work to be done
> during shutdown - we don't initialize anything, etc.
>
> Maybe much of those 240 msecs are spent in some stupid udelay loop or so, which
> could be made parallel?
I was hoping for a stupid udelay when I first started looking
at this code, but found nothing obvious.
The bulk of the time (after making the cpu bitmask change) is
spent in __cpu_notify(), as explained above.
> Would it be possible to create a 'reboot but stop at the end and reactivate all
> CPUs again' reboot flag, so that it can all be NMI-profiled, to see where the true
> bottleneck is? A naked disable_nonboot_cpus() call in essence.
My testing was similar. I hacked a kernel module to call
disable_nonboot_cpus() and enable_nonboot_cpus() and used
printks to narrow down the slow functions. That points
at the cpu notifier call chain. It's not clear if any
of the functions on the call chain take a long time, or
just going sequentially through the list for all cpus just
takes a long time.
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@....com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists