[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1 of 4] KEXEC: Allocate crash notes on boot



On 09/03/12 15:41, Jan Beulich wrote:
>>>> On 09.03.12 at 15:42, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> +static int __init kexec_init(void)
>> +{
>> +    void *cpu = (void *)(unsigned long)smp_processor_id();
>> +
>> +    /* If no crash area, no need to allocate space for notes. */
>> +    if ( !kexec_crash_area.size )
>> +        return 0;
>> +
>> +    register_keyhandler('C', &crashdump_trigger_keyhandler);
> Wouldn't this better be done only after successful crash_notes
> allocation below?

Yes

>> +
>> +    crash_notes = xmalloc_array(crash_note_range_t, nr_cpu_ids);
>> +    if ( ! crash_notes )
>> +        return -ENOMEM;
>> +
>> +    memset(crash_notes, 0, sizeof(crash_note_range_t) * nr_cpu_ids);
> Using xzalloc_array() above would be preferred.
>

Doh! I started this patch against unstable, with xzalloc, then ported to
4.1 without xzalloc, then ported back to unstable and forgot to change.

I will respin it

>> +
>> +    cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
>> +    register_cpu_notifier(&cpu_nfb);
>> +    return 0;
>> +}
> Looks okay otherwise, but I'm still not fully convinced all this is really
> needed.
>
> Jan
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.