public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
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: make use of inc/dec conditional
Date: Wed, 19 Aug 2009 10:01:00 +0200	[thread overview]
Message-ID: <1250668860.7583.327.camel@twins> (raw)
In-Reply-To: <4A8BCA850200007800010836@vpn.id2.novell.com>

On Wed, 2009-08-19 at 08:48 +0100, Jan Beulich wrote:
> According to gcc's instruction selection, inc/dec can be used without
> penalty on most CPU models, but should be avoided on others. Hence we
> should have a config option controlling the use of inc/dec, and
> respective abstraction macros to avoid making the resulting code too
> ugly. There are a few instances of inc/dec that must be retained in
> assembly code, due to that code's dependency on the instruction not
> changing the carry flag.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> ---
>  arch/x86/Kconfig.cpu                |    4 ++++
>  arch/x86/include/asm/asm.h          |   27 +++++++++++++++++++++++++++
>  arch/x86/include/asm/atomic_32.h    |    8 ++++----
>  arch/x86/include/asm/atomic_64.h    |   16 ++++++++--------
>  arch/x86/include/asm/checksum_32.h  |    2 +-
>  arch/x86/include/asm/spinlock.h     |    6 +++---
>  arch/x86/lib/checksum_32.S          |   11 ++++++-----
>  arch/x86/lib/clear_page_64.S        |    3 ++-
>  arch/x86/lib/copy_page_64.S         |    5 +++--
>  arch/x86/lib/copy_user_64.S         |   17 +++++++++--------
>  arch/x86/lib/copy_user_nocache_64.S |   17 +++++++++--------
>  arch/x86/lib/memcpy_64.S            |   11 ++++++-----
>  arch/x86/lib/memset_64.S            |    7 ++++---
>  arch/x86/lib/rwlock_64.S            |    5 +++--
>  arch/x86/lib/semaphore_32.S         |    7 ++++---
>  arch/x86/lib/string_32.c            |   23 ++++++++++++-----------
>  arch/x86/lib/strstr_32.c            |    5 +++--
>  17 files changed, 108 insertions(+), 66 deletions(-)

What's the performance gain? This seems like a rather large and ugly
patch if the result is borderline.

  reply	other threads:[~2009-08-19  8:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19  7:48 [PATCH] x86: make use of inc/dec conditional Jan Beulich
2009-08-19  8:01 ` Peter Zijlstra [this message]
2009-08-19  9:00   ` Jan Beulich
2009-08-19  9:06     ` Thomas Gleixner
2009-08-19  9:23       ` Jan Beulich
2009-08-19  9:56         ` Thomas Gleixner
2009-08-19 16:48 ` H. Peter Anvin
2009-08-20  7:12   ` Jan Beulich
2009-08-27  7:34     ` Tejun Heo
2009-08-28  6:31       ` Jan Beulich

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=1250668860.7583.327.camel@twins \
    --to=peterz@infradead.org \
    --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