From: Andi Kleen <ak@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: adilger@clusterfs.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use unlikely() for current_kernel_time() loop
Date: Thu, 8 Jun 2006 07:39:33 +0200 [thread overview]
Message-ID: <200606080739.33967.ak@suse.de> (raw)
In-Reply-To: <20060607220118.f0c64086.akpm@osdl.org>
On Thursday 08 June 2006 07:01, Andrew Morton wrote:
> On 08 Jun 2006 04:28:12 +0200
> Andi Kleen <ak@suse.de> wrote:
>
> > Andreas Dilger <adilger@clusterfs.com> writes:
> >
> > > Hello,
> > > I just noticed this minor optimization. current_kernel_time() is called
> > > from current_fs_time() so it is used fairly often but it doesn't use
> > > unlikely(read_seqretry(&xtime_lock, seq)) as other users of xtime_lock do.
> > > Also removes extra whitespace on the empty line above.
> >
> > It would be better to put the unlikely into the read_seqretry I guess.
> >
>
> yup. But it'd be good to check that this actually causes the compiler to
> do the right thing, rather than simply ignoring it.
If it was put into a macro wrapper it should be safe enough.
>
> I'm not sure how one would do that though. I guess compare
> before-and-after assembly code, work out if "after" is better.
Nothing on x86-64 at least - it uses -fno-reorder-blocks by default.
-Andi
next prev parent reply other threads:[~2006-06-08 5:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-07 17:36 [PATCH] use unlikely() for current_kernel_time() loop Andreas Dilger
2006-06-08 2:28 ` Andi Kleen
2006-06-08 5:01 ` Andrew Morton
2006-06-08 5:39 ` Andi Kleen [this message]
2006-06-08 6:41 ` Brian F. G. Bidulock
2006-06-08 6:51 ` Andi Kleen
2006-06-08 7:00 ` Brian F. G. Bidulock
2006-06-08 7:07 ` Andi Kleen
2006-06-08 7:43 ` Brian F. G. Bidulock
2006-06-08 8:59 ` Brian F. G. Bidulock
2006-06-08 9:14 ` Andi Kleen
2006-06-08 9:36 ` Brian F. G. Bidulock
2006-06-08 10:20 ` Andi Kleen
2006-06-08 10:50 ` Brian F. G. Bidulock
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=200606080739.33967.ak@suse.de \
--to=ak@suse.de \
--cc=adilger@clusterfs.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.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