[prev in list] [next in list] [prev in thread] [next in thread]
List: osdl-fastboot
Subject: [Fastboot] Re: [PATCH 3/4] Kexec based crash dumps
From: Andrew Morton <akpm () osdl ! org>
Date: 2004-07-28 20:12:59
Message-ID: 20040728131259.614b689d.akpm () osdl ! org
[Download RAW message or body]
Hariprasad Nellitheertha <hari@in.ibm.com> wrote:
>
> This patch contains the code for snapshotting the register contents of all
> cpus before rebooting.
>
> +static int crash_dump_nmi_callback(struct pt_regs *regs, int cpu)
> +{
> + if (!crash_dump_expect_ipi[cpu])
> + return 0;
> +
> + crash_dump_expect_ipi[cpu] = 0;
> + crash_dump_save_this_cpu(regs, cpu);
> + atomic_dec(&waiting_for_dump_ipi);
> +
> + stop_this_cpu(NULL);
> +
> + return 1;
> +}
Whitespace damage (please use tabs)
> +void __crash_dump_stop_cpus(void)
> +{
> + int i, cpu = smp_processor_id();
> + int other_cpus = num_online_cpus()-1;
ditto
> + if (other_cpus > 0) {
> + atomic_set(&waiting_for_dump_ipi, other_cpus);
> +
> + for (i = 0; i < NR_CPUS; i++) {
> + crash_dump_expect_ipi[i] = (i != cpu && cpu_online(i));
> + }
extraneous braces.
> +
> + set_nmi_callback(crash_dump_nmi_callback);
> + wmb();
Barriers should always have a comment explaining what they're barriering.
> + crash_dump_send_ipi();
> + while (atomic_read(&waiting_for_dump_ipi) > 0) {
> + cpu_relax();
> + }
braces.
> + if (vector == CRASH_DUMP_VECTOR)
> + cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
> +
> /*
> * Send the IPI. The write to APIC_ICR fires this off.
> */
> @@ -222,6 +225,9 @@ inline void send_IPI_mask_sequence(cpuma
> */
> cfg = __prepare_ICR(0, vector);
>
> + if (vector == CRASH_DUMP_VECTOR)
> + cfg = (cfg&~APIC_VECTOR_MASK)|APIC_DM_NMI;
> +
This patch will need some description of the APIC frobbing. Comments would
be nice, too.
_______________________________________________
fastboot mailing list
fastboot@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/fastboot
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic