linux-mips
[Top] [All Lists]

Re: [PATCH] clean up ret_from_{irq,exception}

To: vagabon.xyz@gmail.com
Subject: Re: [PATCH] clean up ret_from_{irq,exception}
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sun, 11 Feb 2007 00:40:20 +0900 (JST)
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <45C8A477.8070906@innova-card.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <45C8A477.8070906@innova-card.com>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 06 Feb 2007 16:53:27 +0100, Franck Bui-Huu <vagabon.xyz@gmail.com> 
wrote:
> This patch makes these routines a lot more readable whatever
> the value of CONFIG_PREEMPT.
> 
> It also moves one branch instruction from ret_from_irq()
> to ret_from_exception(). Therefore we favour the return
> from irq path which should be more common than the other
> one.

After this patch, entry.S becomes:

FEXPORT(ret_from_exception)
#ifndef CONFIG_PREEMPT
        local_irq_disable                       # preempt stop
#endif
        b       _ret_from_irq
FEXPORT(ret_from_irq)
        LONG_S  s0, TI_REGS($28)
FEXPORT(_ret_from_irq)


Apparently your patch add an additional branch in critical path in
CONFIG_PREEMPT=y case.

Maybe this would be better?

#ifdef CONFIG_PREEMPT
FEXPORT(ret_from_irq)
        LONG_S  s0, TI_REGS($28)
FEXPORT(ret_from_exception)
#else
FEXPORT(ret_from_exception)
        local_irq_disable                       # preempt stop
        b       _ret_from_irq
FEXPORT(ret_from_irq)
        LONG_S  s0, TI_REGS($28)
#endif
FEXPORT(_ret_from_irq)

---
Atsushi Nemoto

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