linux-mips
[Top] [All Lists]

Re: LL/SC benchmarking [was: Mipsel libc with LL/SC online anywhere?]

To: Johannes Stezenbach <js@convergence.de>, Jun Sun <jsun@mvista.com>, linux-mips@oss.sgi.com
Subject: Re: LL/SC benchmarking [was: Mipsel libc with LL/SC online anywhere?]
From: "Kevin D. Kissell" <kevink@mips.com>
Date: Fri, 26 Jul 2002 12:35:13 -0700
Organization: MIPS Technologies Inc.
References: <00ce01c229a4$a7d4ed40$10eca8c0@grendel> <20020719123828.GA5521@convergence.de> <20020725162539.GA8804@convergence.de> <3D40302F.40806@mvista.com> <20020725184519.GB9302@convergence.de> <3D407254.233BE0DB@mips.com>
Sender: owner-linux-mips@oss.sgi.com
"Kevin D. Kissell" wrote:
> The prudent thing to do would be to load the MAGIC_COOKIE
> value explicitly into k1 on the way out of general exception
> service.  Fortunately, it looks to me as if at least half
> of the overhead of this operation (LUI/ORI) can be concealed
> in branch/jump delay slots that are currently going unfilled.

I was distracted in the middle of that reply and got confused.
The MAGIC_COOKIE needs only to be destroyed, which can be 
done in a single instruction.  The 100% safe approach would
be to insert a "move k1,zero" instruction before all ERETs,
including those generated by the RESTORE_ALL_AND_RET macro
expansion, but it should faster, if very slightly larger 
and somewhat more burdensome for maintenence, to plant those
instructions in branch delay slots just "upstream" from the
context restore.  I'm working on the code a bit and may
be able to propose (if not test :-) a patch along these
lines, but in looking at entry.S, I note something a bit
disturbing:

There's a lot of code in there that allows the assembler
to schedule the instructions, but which also contains
SSNOPs to force timing.  Isn't that a bit dangerous?
Unless it is specified that the assembler will refuse
to reschedule SSNOPs, I think those sequences need to
be bracketed with .noreorder directives.  That would
also allow k1 destructors to be placed explicitly in
the delay slots, rather than assuming that they will
be put there by the assembler.

        Regards,

        Kevin K.


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