linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Wedson Almeida Filho <wedsonaf@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86: Use asm-goto to implement mutex fast path on x86-64
Date: Fri, 28 Jun 2013 07:14:58 -0700	[thread overview]
Message-ID: <51CD9A62.3020404@zytor.com> (raw)
In-Reply-To: <1372420245-60021-1-git-send-email-wedsonaf@gmail.com>

On 06/28/2013 04:50 AM, Wedson Almeida Filho wrote:
> The new implementation allows the compiler to better optimize the code; the
> original implementation is still used when the kernel is compiled with older
> versions of gcc that don't support asm-goto.
> 
> Compiling with gcc 4.7.3, the original mutex_lock() is 60 bytes with the fast
> path taking 16 instructions; the new mutex_lock() is 42 bytes, with the fast
> path taking 12 instructions.
> 
> The original mutex_unlock() is 24 bytes with the fast path taking 7
> instructions; the new mutex_unlock() is 25 bytes (because the compiler used
> a 2-byte ret) with the fast path taking 4 instructions.
> 
> The two versions of the functions are included below for reference.
> 

As Ingo said, looks very nice.  However, it is really too late for Linux
3.11, so I'm going to put it on a queue I already have for 3.12.

	-hpa



  reply	other threads:[~2013-06-28 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 11:50 [PATCH v2] x86: Use asm-goto to implement mutex fast path on x86-64 Wedson Almeida Filho
2013-06-28 14:14 ` H. Peter Anvin [this message]
2013-06-29  6:35   ` Wedson Almeida Filho
2013-07-05 14:24 ` [tip:x86/asm] " tip-bot for Wedson Almeida Filho

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=51CD9A62.3020404@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wedsonaf@gmail.com \
    --cc=x86@kernel.org \
    /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).