Re: [PATCH] printk: use this_cpu_{read|write} api on printk_pending

From: Eric Dumazet
Date: Fri Nov 26 2010 - 12:00:00 EST


Le vendredi 26 novembre 2010 Ã 10:40 -0600, Christoph Lameter a Ãcrit :

> This only works if printk_needs_cpu is always passed the current cpu. The
> check for cpu_is_offline suggests that the function is also used for other
> cpus. The __this_cpu_read() will then get the printk_pending stat for the
> current cpu and not for the specified cpu.
>
>

I guess you read the changelog too fast ;)

I posted this patch after noticing printk_needs_cpu() was always used
for the current cpu.

We have other functions around, that always work for the current cpu.

We pass cpu as a parameter, mostly because smp_processor_id() was a bit
expensive in old kernels, and is still expensive because of sanity
tests.

Now we have this_cpu_ api, we probably can do a cleanup to avoid now
useless parameter passing.

If we had this_cpu_is_online() function, we could avoid (int cpu) param
in printk_needs_cpu()



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