Re: [PATCH] atomic_inc_return() for i386[1/5] (Re: atomic_inc_return)

From: Andi Kleen
Date: Sun Sep 12 2004 - 03:31:46 EST


On Sat, Sep 11, 2004 at 04:05:32PM -0700, Andrew Morton wrote:
> kaigai@xxxxxxxxxxxxx (Kaigai Kohei) wrote:
> >
> >
> > [1/5] atomic_inc_return-linux-2.6.9-rc1.i386.patch
> > This patch implements atomic_inc_return() and so on for i386,
> > and includes runtime check whether CPU is legacy 386.
> > It is same as I posted to LKML and Andi Kleen at '04/09/01.
> >
>
> Can we not use the `alternative instruction' stuff to eliminate the runtime
> test?

Yes, we could. I suggested this to Kaigai-san earlier, but
he decided that it was too complicated because he would have needed
to add an additional alternative() macro with enough parameters.

Given that atomic instructions are quite costly anyways and the jump
should be very predictable he's probably right that it wouldn't
be worth the effort.

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