linux-mips
[Top] [All Lists]

Re: Benchmark performance

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: Benchmark performance
From: Carsten Langgaard <carstenl@mips.com>
Date: Thu, 16 Aug 2001 13:07:28 +0200
Cc: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>, wgowcher@yahoo.com, linux-mips@oss.sgi.com
References: <20010809215522.A1958@lucon.org> <20010813173446.61234.qmail@web11901.mail.yahoo.com> <20010816125652N.nemoto@toshiba-tops.co.jp> <20010816111803.A17469@bacchus.dhis.org>
Sender: owner-linux-mips@oss.sgi.com
Ralf Baechle wrote:

> On Thu, Aug 16, 2001 at 12:56:52PM +0900, Atsushi Nemoto wrote:
>
> > >>>>> On Mon, 13 Aug 2001 10:34:46 -0700 (PDT), Wayne Gowcher 
> > >>>>> <wgowcher@yahoo.com> said:
> > wgowcher> a 23 % reduction in the Floating Point Index benchmark
> >
> > Current CVS kernel uses FPU emulator unconditionally.  If one floating
> > point intruction causes a 'Unimplemented' exception (denormalized
> > result, etc.) following floating point instructions are also handle by
> > FPU emulator (not only the instruction which raise the exception).
> >
> > I do not know this is really desired behavior, but here is a patch to
> > change this.  If Unimplemented exception had been occured during the
> > benchmark, aplying this patch may result better performance.
>
> This is a know problem with the emulator.  It may be used to keep the
> emulator in kernel for a long time or even maliciously to keep the
> CPU in the kernel for an unbounded time.
>
> Here's my suggested fix:
>
> Index: arch/mips/math-emu/cp1emu.c
> ===================================================================
> RCS file: /home/pub/cvs/linux/arch/mips/math-emu/cp1emu.c,v
> retrieving revision 1.7
> diff -u -r1.7 cp1emu.c
> --- arch/mips/math-emu/cp1emu.c 2001/08/02 21:55:26     1.7
> +++ arch/mips/math-emu/cp1emu.c 2001/08/16 09:06:55
> @@ -1672,6 +1672,9 @@
>
>         oldepc = xcp->cp0_epc;
>         do {
> +               if (current->need_resched)
> +                       break;
> +
>                 prevepc = xcp->cp0_epc;
>                 insn = mips_get_word(xcp, REG_TO_VA(xcp->cp0_epc), &err);
>                 if (err) {
>
>   Ralf

What is probably needed too, but I still think we need the check for real FPU, 
so we only
emulate one instruction at a time, if we got a real FPU.


--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com




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