[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC] KEXEC: allocate crash note buffers at boot time v3
>>> On 01.12.11 at 16:02, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: > On 01/12/11 12:56, Jan Beulich wrote: >>>>> On 01.12.11 at 13:29, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote: >>> +static spinlock_t crash_notes_lock = SPIN_LOCK_UNLOCKED; >> Please use DEFINE_SPINLOCK() here. >> >>> + register_keyhandler('C', &crashdump_trigger_keyhandler); >>> + >>> + /* If no crash area, no need to allocate space for notes. */ >>> + if ( 0 == kexec_crash_area.size ) >>> + return 0; >> Wouldn't it make sense to switch the order of these? >> >>> + crash_notes = xmalloc_bytes(nr_cpu_ids * sizeof(void*)); >> Please use xmalloc_array() here. >> >>> + if ( !crash_notes[nr] && 0 != kexec_init_cpu_notes(nr) ) >> The first check is pointless - the function will return zero if the >> allocation was already done. > > I forgot to say in my previous email. Short circuit evaluation should > prevent the kexec_init_cpu_notes() function call actually being made. What would that buy you? Performance is not an issue on this code path. Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |