Re: [PATCH 1/6] x86: Limit the number of processor bootup messages

From: Ingo Molnar
Date: Mon Nov 16 2009 - 16:23:20 EST



* Mike Travis <travis@xxxxxxx> wrote:

> + if (cpu == 0)
> + printk(KERN_INFO "CPU0: Thermal monitoring enabled (%s)\n",
> + tm2 ? "TM2" : "TM1");

Hm, 'cpu==0 means boot cpu' assumptions are not particularly clean.

> +#ifdef CONFIG_NUMA
> + if (system_state == SYSTEM_BOOTING) {
> + static int current_node = -1;
> + int node = cpu_to_node(cpu);
> +
> + if (node != current_node) {
> + if (current_node > (-1))
> + pr_cont(" Ok.\n");
> + current_node = node;
> + pr_info("Booting Node %3d, Processors ", node);
> + }
> + pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " Ok.\n" : "");
> + } else
> +#endif
> + pr_info("Booting Processor %d APIC 0x%x\n", cpu, apicid);

preprocessor directives cutting into if/else branches in an assymetric
way is being frowned upon. I'd also suggest to put this into a helper
inline.

Is the SYSTEM_BOOTING check there to not re-print this on CPU hotplug?

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/