Re: [patch 1/5] x2apic, IR: cleanup X86_X2APIC and INTR_REMAPconfig checks

From: Ingo Molnar
Date: Tue Apr 21 2009 - 02:59:09 EST



* Suresh Siddha <suresh.b.siddha@xxxxxxxxx> wrote:

> Add x2apic_supported() to cleanup CONFIG_X86_X2APIC checks.
>
> Fix CONFIG_INTR_REMAP checks.
>
> Signed-off-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
> Cc: Weidong Han <weidong.han@xxxxxxxxx>
> ---
>
> Index: tip/arch/x86/include/asm/apic.h

Ob'nit'pick: please generate diffstats for future patches as it
makes in-email review much easier.

The diffstat is:

arch/x86/include/asm/apic.h | 10 +++----
arch/x86/include/asm/io_apic.h | 2 -
arch/x86/include/asm/irq_remapping.h | 2 -
arch/x86/kernel/apic/apic.c | 49 ++++++++---------------------------
arch/x86/kernel/apic/io_apic.c | 2 -
arch/x86/kernel/apic/probe_64.c | 2 -
include/linux/dmar.h | 2 +
7 files changed, 21 insertions(+), 48 deletions(-)

Which already shows that the patch has a very nice cleanup factor.

I've added an "[ Impact: cleanup ]" tag to it - the patch is not
supposed to have any functional side-effects, right? (i.e. has no
fixes embedded in it.)

a question:

> if (intr_remapping_enabled)
> disable_intr_remapping();

Could the intr_remapping_enabled check be moved inside
disable_intr_remapping(), and thus the ugly 'if (flag)' construct
could go away?

> if (intr_remapping_enabled) {
> + reenable_intr_remapping(x2apic_mode);
> unmask_8259A();
> restore_IO_APIC_setup(ioapic_entries);
> free_ioapic_entries(ioapic_entries);
> }

Ditto - shouldnt this sequence move into reenable_intr_remapping() -
or into a new helper function? (or is it too single-purpose)

Anyway, this already looks good as-is so i can apply it if you do
delta patches on top of it to improve it further.

Ingo
--
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/