linux-mips
[Top] [All Lists]

Re: Benchmark performance

To: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Subject: Re: Benchmark performance
From: Ralf Baechle <ralf@oss.sgi.com>
Date: Thu, 16 Aug 2001 11:18:03 +0200
Cc: wgowcher@yahoo.com, linux-mips@oss.sgi.com
In-reply-to: <20010816125652N.nemoto@toshiba-tops.co.jp>; from nemoto@toshiba-tops.co.jp on Thu, Aug 16, 2001 at 12:56:52PM +0900
References: <20010809215522.A1958@lucon.org> <20010813173446.61234.qmail@web11901.mail.yahoo.com> <20010816125652N.nemoto@toshiba-tops.co.jp>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
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

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