On Fri, Feb 21, 2014 at 08:14:10AM -0500, Vivek Goyal wrote:
On Thu, Feb 20, 2014 at 06:09:30PM -0700, Jerry Hoemann wrote:
> == Version 2 ==
>
> Addresses Vivek's review comments:
>
> 1. Don't force numeric in awk script snipet.
>
> 2. Command line processing is moved from load_kernel to new function
> "prepare_cmdline." This new function is responsible for
> setting up the command line passed to KEXEC.
>
> 3. New function "append_cmdline" is added to append {argument,value}
> pair to command line if argument is not already present.
>
> == Version 1 ==
>
> A recent patch (
https://lkml.org/lkml/2014/1/15/42) enables multiple
> processors in the crash kernel.
>
> To do this safely the crash kernel needs to know which CPU was the 1st
> kernel BSP (bootstrap processor) so that the crash kernel will NOT send
> the BSP an INIT. If the crash kernel sends an INIT to the 1st kernel
> BSP, some systems may reset or hang.
>
> The EFI spec doesn't require that any particular processor is chosen
> as the BSP and the CPU (and its apic id) can change from one boot to
> the next. Hence automating the selection of CPU to disable if the
> system would panic is desired.
>
> This patch updates the kdumpctl script to get the "initial apicid"
> of CPU 0 in the first kernel and will pass this as the
> "disable_cpu_apicid=" arguement to kexec if it wasn't explicitly
> set in /etc/sysconfig/kdump KDUMP_COMMANDLINE_APPEND.
>
> CPU 0 is chosen as it is the processor thats execute the OS
> initialization
> code and hence was the BSP as per x86 SDM (Vol 3a Section 8.4.)
>
> See associated Red Hat Bugzilla(s) for additional background material:
>
>
https://bugzilla.redhat.com/show_bug.cgi?id=1059031
>
https://bugzilla.redhat.com/show_bug.cgi?id=980621
> ---
> kdumpctl | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 54 insertions(+), 7 deletions(-)
Thanks Jerry. This version looks good to me.
Can you please test the disable_cpu_apicid override functionality by
specifying it /etc/sysconfig/kdump and make sure it is working.
Acked-by: Vivek Goyal <vgoyal(a)redhat.com>
Thanks
Vivek
A. On a prototype system that exihibits the underlying problem w/ INIT
to the 1st kernel BSP causing a hang.
B. System running RHEL 7.0 snap 6 plus kernel w/ Daisuke's patch
C. Using the modified kdumpctl script I sent yesterday.
D. Processor w/ APIC ID == 0 was deconfigured, so BSP has APIC ID == 2.
1) ran five crash dumps injecting error (echo c > /proc/sysrq-trigger)
on random cpu successfully. crash kernel had nr_cpus=4.
Crash dumps were successful.
2) Then configured /etc/sysconf/kdump to specify disable_cpu_apicid=0.
Injected error on CPU 24. This time the crash kernel hung when
bringing other processors on line.
The second test shows the crash kernel was looking to avoid INIT
of APICID 0, not as it should of in the case of this system which
has BSP w/ initial apicid of 2. (note, in development of the
script I had an echo of the command line argument and tested
this case to verify that explicit override was honored.)
I used RHEL 7.0 as I had access to RHEL 7 kernel that had Daisuke's
patch applied (not sure about Fedora kernels in this respect.)
Both RHEL 7.0 and Fedora 20 had the same kdumpctl scripts prior
to my modifications.
Jerry
--
----------------------------------------------------------------------------
Jerry Hoemann Software Engineer Hewlett-Packard
3404 E Harmony Rd. MS 57 phone: (970) 898-1022
Ft. Collins, CO 80528 FAX: (970) 898-XXXX
email: jerry.hoemann(a)hp.com
----------------------------------------------------------------------------