[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878weyy2xm.fsf@basil.nowhere.org>
Date: Mon, 26 Oct 2009 09:28:21 +0100
From: Andi Kleen <andi@...stfloor.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
Jan Beulich <JBeulich@...ell.com>, mingo@...e.hu,
tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86-64: adjust ia32entry branches for better static prediction
"H. Peter Anvin" <hpa@...or.com> writes:
> On 10/20/2009 04:21 PM, Eric Dumazet wrote:
>>>
>>> --- linux-2.6.32-rc5/arch/x86/ia32/ia32entry.S 2009-10-19 13:12:43.000000000 +0200
>>> +++ 2.6.32-rc5-x86_64-ia32-syscall-trace-branch-dir/arch/x86/ia32/ia32entry.S 2009-10-19 09:36:39.000000000 +0200
>>> @@ -249,9 +249,9 @@ sysenter_tracesys:
>>> call syscall_trace_enter
>>> LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
>>> RESTORE_REST
>>> - cmpl $(IA32_NR_syscalls-1),%eax
>>> - ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
>>> - jmp sysenter_do_call
>>> + cmpl $IA32_NR_syscalls,%eax
>>> + jb sysenter_do_call
>>> + jmp int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
>>> CFI_ENDPROC
>>
>> on cmov enabled build, we could use cmov instruction to load eax with number
>> that calls enosys_syscall(), to avoid loading -ENOSYS,RAX
>> and these branches...
>>
>
> It's x86-64, cmov is guaranteed.
But it's also not necessarily faster.
-Andi
--
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists