From: Nick Piggin <npiggin@suse.de>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 2/3] ipc: use shifts to extract seq/idx
Date: Fri, 21 May 2010 11:33:00 +1000 [thread overview]
Message-ID: <20100521013300.GJ2516@laptop> (raw)
In-Reply-To: <4BF57C78.4040606@colorfullife.com>
On Thu, May 20, 2010 at 08:16:24PM +0200, Manfred Spraul wrote:
> On 05/20/2010 09:00 AM, Nick Piggin wrote:
> >All the ipc ids and sequences are signed integers, so power of 2
> >sequence multiplier does not work so well. Convert it to use shifts,
> >which improves generated code particularly in ipc_lock/ipc_lock_check
> >fast paths.
> >
> Have you checked the asm output?
Yep, it's quite improved (although this isn't a particularly hot
path I thought it is a good cleanup).
> I would expect that gcc auto-optimizes constant divides by power-of-two.
It can't with signed I guess.
next prev parent reply other threads:[~2010-05-21 1:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 6:59 [patch 1/3] ipc: rename IPCMNI to IPCMNI_MAX Nick Piggin
2010-05-20 7:00 ` [patch 2/3] ipc: use shifts to extract seq/idx Nick Piggin
2010-05-20 18:16 ` Manfred Spraul
2010-05-21 1:33 ` Nick Piggin [this message]
2010-05-20 7:07 ` [patch 3/3] ipc: increase IPCMNI_MAX Nick Piggin
2010-05-21 20:31 ` Andrew Morton
2010-05-24 7:43 ` Nick Piggin
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=20100521013300.GJ2516@laptop \
--to=npiggin@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
/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