linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86-64: adjust ia32entry branches for better static	 prediction
Date: Tue, 20 Oct 2009 09:21:32 +0200	[thread overview]
Message-ID: <4ADD64FC.3070006@gmail.com> (raw)
In-Reply-To: <4ADD7E6C020000780001AD73@vpn.id2.novell.com>

Jan Beulich a écrit :
> Swap branch pairs so that the static branch prediction logic would
> consider the syscall-number-in-range case the taken path.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> ---
>  arch/x86/ia32/ia32entry.S |   18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> --- 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...


  reply	other threads:[~2009-10-20  7:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20  7:10 [PATCH] x86-64: adjust ia32entry branches for better static prediction Jan Beulich
2009-10-20  7:21 ` Eric Dumazet [this message]
2009-10-20  7:24   ` H. Peter Anvin
2009-10-26  8:28     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ADD64FC.3070006@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=JBeulich@novell.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).