linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [patch] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES
@ 2006-01-11  8:24 Chuck Ebbert
  2006-01-11 10:13 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Ebbert @ 2006-01-11  8:24 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Hugh Dickins, Ingo Molnar, Linus Torvalds, linux-kernel

In-Reply-To: <20060110210744.GA8850@elte.hu>

On Tue, 10 Jan 2006 at 22:07:44 +0100, Ingo Molnar wrote:

> --- linux.orig/include/asm-i386/mutex.h
> +++ linux/include/asm-i386/mutex.h
> @@ -28,7 +28,13 @@ do {                                                                       \
>                                                                       \
>       __asm__ __volatile__(                                           \
>               LOCK    "   decl (%%eax)        \n"                     \
> -                     "   js "#fail_fn"       \n"                     \
> +                     "   js 2f               \n"                     \
> +                     "1:                     \n"                     \
> +                                                                     \
> +             LOCK_SECTION_START("")                                  \
> +                     "2: call "#fail_fn"     \n"                     \
> +                     "   jmp 1b              \n"                     \
> +             LOCK_SECTION_END                                        \
>                                                                       \
>               :"=a" (dummy)                                           \
>               : "a" (count)                                           \


But now it's inefficient again.

Why not this:

                LOCK    "   decl (%%eax)        \n"                     \
                        "   jns 1f              \n"                     \
                        "   call "#fail_fn"     \n"                     \
                        "1:                     \n"                     \
                                                                        \
                :"=a" (dummy)                                           \
                : "a" (count)                                           \


Will the extra taken forward conditional jump in the fastpath cause much of
a slowdown?

-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [patch] fix i386 mutex fastpath on FRAME_POINTER &&  !DEBUG_MUTEXES
@ 2006-01-12 17:53 Chuck Ebbert
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Ebbert @ 2006-01-12 17:53 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Linus Torvalds, Hugh Dickins, Ingo Molnar

In-Reply-To: <Pine.LNX.4.58.0601110511590.24014@devserv.devel.redhat.com>

On Wed, 11 Jan 2006, Ingo Molnar wrote:

> On Wed, 11 Jan 2006, Chuck Ebbert wrote:
>
> > 
> >                 LOCK    "   decl (%%eax)        \n"                     \
> >                         "   jns 1f              \n"                     \
> >                         "   call "#fail_fn"     \n"                     \
> >                         "1:                     \n"                     \
> >                                                                         \
> >                 :"=a" (dummy)                                           \
> >                 : "a" (count)                                           \
> > 
> > 
> > Will the extra taken forward conditional jump in the fastpath cause much
> > of a slowdown?
> 
> yeah - the fastpath is much more common than the slowpath.

But that's how the spinlock code does it.  Should that be changed to put the
spinloops in .text.lock and make the fastpaths a fall-through?

-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

^ permalink raw reply	[flat|nested] 4+ messages in thread
* i386 FRAME_POINTER needs DEBUG_MUTEXES
@ 2006-01-10 17:44 Hugh Dickins
  2006-01-10 21:07 ` [patch] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Hugh Dickins @ 2006-01-10 17:44 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel

I find the 2.6.15-git6 i386 CONFIG_FRAME_POINTER=y doesn't work unless
CONFIG_DEBUG_MUTEXES=y, because of the __mutex_fastpath jumps to fail_fn
(giving two pushes of %ebp to one pop).  Whereas x86_64 __mutex_fastpaths
use calls and work with FRAME_POINTER=y.  Whether i386 deserves asm mods
rather than Kconfigery to force one from other, I've no strong instinct.

Hugh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-12 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-11  8:24 [patch] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES Chuck Ebbert
2006-01-11 10:13 ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2006-01-12 17:53 Chuck Ebbert
2006-01-10 17:44 i386 FRAME_POINTER needs DEBUG_MUTEXES Hugh Dickins
2006-01-10 21:07 ` [patch] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).