linux-mips
[Top] [All Lists]

Re: [PATCH]: R10000 Needs LL/SC Workaround in Glibc

To: Kumba <kumba@gentoo.org>
Subject: Re: [PATCH]: R10000 Needs LL/SC Workaround in Glibc
From: Ralf Baechle <ralf@linux-mips.org>
Date: Sat, 1 Nov 2008 11:26:43 +0000
Cc: libc-ports@sources.redhat.com, Daniel Jacobowitz <drow@false.org>, Linux MIPS List <linux-mips@linux-mips.org>
In-reply-to: <490A912A.8030901@gentoo.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <490A912A.8030901@gentoo.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, Oct 31, 2008 at 01:01:30AM -0400, Kumba wrote:

> +#ifndef (_MIPS_ARCH_R10000)
> +#define R10K_BEQZ_INSN "beqz %1,1b\n"
> +#else
> +#define R10K_BEQZ_INSN "beqzl        %1,1b\n"
> +#endif

In the kernel we have very good knowledge about what types of processors
are being used for what configuration; much less in userland and the code
as suggested by you would result in a silent failure on affected R10000
machines if version built not for the R10000 was being used - iow no
improvment over what we have right now.  So for userland I'd prefer to

 o MIPS I builds: use the some 28 nops.
 o Builds for MIPS II or better: always use the branch likely
 o A runtime test would have to be implemented pessimisticall because it
   would have to rely on /proc being mounted which isn't available early in
   the boot process.  It's probably going to add more overhead than it
   saves anyway.

There is a price for using branch likely - but not that high.  In the grand
picture it'll almost certainly vanish in the benchmarking noise.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>