Re: FEATURE REQUEST: Specific Processor Optimizations on x86Architecture

From: Andi Kleen
Date: Mon Oct 27 2003 - 13:34:20 EST


"J.A. Magallon" <jamagallon@xxxxxxx> writes:

> Patch inlined. Credits should go to Zwane Mwaikambo <zwane@xxxxxxxxxxxxxxxxxxx>.
> It adds the corresponding flags for PII) and P4, and in case thei are defined,
> the *fence insn are used.
>
> Included is also one other patch by Zwane, which states that smp_call_function
> needs mb() instead of wmb().
>
> I use them regularly, so they look safe. Are they really better ? At least they
> do not touch any register, like the trick used till now.

The current code also does not touch any register. It has a gcc memory
barrier, which is costly, but needed.

The wmb() change is not needed, unless you have an oostore CPU
(x86 has ordered writes by default). It probably does not hurt
neither though (I do it the same way on x86-64), but also doesn't
change anything.

I think overall the patch is a very bad idea because it adds weird CPU
dependencies to the image again for very little again If you really
want to do this use alternative() and runtime patching. But it's
probably not worth the effort - don't do it until you can demonstrate
a difference in any benchmark.

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