Re: [RFC 11/13] genapic: reduce stack pressuge in io_apic.c step3 target_cpus

From: Mike Travis
Date: Mon Sep 08 2008 - 11:29:57 EST


Bert Wesarg wrote:
> On Sun, Sep 7, 2008 at 01:50, Mike Travis <travis@xxxxxxx> wrote:
>> * Step 3 "target_cpus" of cleaning up io_apic.c modifies the TARGET_CPUS
>> interface to pass a pointer to the returned mask for arch X86_64,
>> removing yet another "cpumask_t variable on the stack".
>>
>> target_cpus = TARGET_CPUS;
>>
>> becomes:
>>
>> TARGET_CPUS(target_cpus);
>>
>> For x86_32 this is expanded to:
>>
>> target_cpus = (genapic->target_cpus());
>>
>> For x86_64 this is expanded to:
>>
>> target_cpus = (genapic->target_cpus)(&(target_cpus));
> But its expended to:
> (genapic->target_cpus)(&(target_cpus));

Umm, right, my cut and paste error...

Thanks,
Mike
>
>> -#define TARGET_CPUS (genapic->target_cpus())
>> +#define TARGET_CPUS(retval) (genapic->target_cpus)(&(retval))
>
>
>> +#ifdef CONFIG_X86_64
>> +#define TARGET_CPUS(retval) (genapic->target_cpus)(&(retval))
>> +#else
>> +#define TARGET_CPUS(retval) retval = (genapic->target_cpus())
>> +#endif
>
> Bert

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/