Re: [patch] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In-Reply-To: <[email protected]>

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux