public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] AFS: Fix file locking
Date: Fri, 20 Jul 2007 14:59:21 +1000	[thread overview]
Message-ID: <46A04129.1020900@yahoo.com.au> (raw)
In-Reply-To: <20070719204102.7b82692d.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Wed, 18 Jul 2007 15:56:53 +1000 Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
> 
>>Andrew Morton wrote:
>>
>>>On Tue, 17 Jul 2007 13:47:32 +0100
>>>David Howells <dhowells@redhat.com> wrote:
>>>
>>>
>>>
>>>>+	if (type == AFS_LOCK_READ &&
>>>>+	    vnode->flags & (1 << AFS_VNODE_READLOCKED)) {
>>>
>>>
>>>Here we use
>>>
>>>	vnode->flags & (1 << foo)
>>>
>>>
>>>
>>>>+		set_bit(AFS_VNODE_LOCKING, &vnode->flags);
>>>
>>>
>>>and elsewhere we use set_bit(foo, &vnode->flags) and clear_bit()
>>>
>>>This is a bit strange.  Does the open-coded bit-test have any performance
>>>benefit on any architecture?  Not on x86 at least, afaik.
>>
>>It uses locked operations on x86, but you can use __set_bit instead
>>(which should always be at least as efficient as the C version).
> 
> 
> I said "bit-test".  ie: test_bit().  That doesn't use a locked operation.

So you did. Then to answer that, yes it could be faster because there are
stupid volatiles sprinkled all over the bitops code so you could easily
end up having to do more loads. Does it make a real difference? Unlikely,
but David loves counting cycles :)

-- 
SUSE Labs, Novell Inc.

  reply	other threads:[~2007-07-21  1:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 12:47 [PATCH] AFS: Fix file locking David Howells
2007-07-18  0:50 ` Andrew Morton
2007-07-18  5:56   ` Nick Piggin
2007-07-20  3:41     ` Andrew Morton
2007-07-20  4:59       ` Nick Piggin [this message]
2007-07-21  1:37         ` Linus Torvalds
2007-07-23  7:07           ` Nick Piggin
2007-07-23  8:50             ` Satyam Sharma
2007-07-23  9:13               ` Satyam Sharma
2007-07-23  9:13           ` David Howells
2007-07-18  9:23   ` David Howells

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=46A04129.1020900@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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