All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Akinobu Mita <mita@miraclelinux.com>
Cc: Greg KH <greg@kroah.com>, Jens Axboe <axboe@suse.de>,
	linux-kernel@vger.kernel.org, akpm@osdl.org,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: [patch 3/3] use kref for bio
Date: Wed, 26 Apr 2006 08:39:44 +0100	[thread overview]
Message-ID: <20060426073944.GL27946@ftp.linux.org.uk> (raw)
In-Reply-To: <20060426072030.GA7693@miraclelinux.com>

On Wed, Apr 26, 2006 at 03:20:30PM +0800, Akinobu Mita wrote:
> If this is good one and the places where Al Viro pointed out really affect
> performance, should we propagate this faster one by introducing helper
> function like:
> 
> static inline int refcount_test(atomic_t *refcount)
> {
> 	return (atomic_read(refcount) == 1) || (atomic_dec_and_test(refcount));
> }
> 
> and replace atomic_dec_and_test with it?

No.  It's obviously slower than atomic_dec_and_test() if refcount is
greater than 1.  And I'm less than sure that you can show that benefits
in case when it is 1 outweight that.  Moreover, for dentries, inodes,
superblocks and vfsmounts you'd have to pull spin_lock() in front of
it, which would _definitely_ hurt (these are atomic_dec_and_lock()).

  reply	other threads:[~2006-04-26  7:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-26  2:10 [patch 0/3] use kref Akinobu Mita
2006-04-26  2:11 ` [patch 1/3] use kref for blk_queue_tag Akinobu Mita
2006-04-26  2:42   ` Nick Piggin
2006-04-26  5:17   ` Greg KH
2006-04-26  2:11 ` [patch 2/3] use kref for io_context Akinobu Mita
2006-04-26  2:11 ` [patch 3/3] use kref for bio Akinobu Mita
2006-04-26  2:26   ` Al Viro
2006-04-26  5:13     ` Jens Axboe
2006-04-26  5:18       ` Greg KH
2006-04-26  7:20         ` Akinobu Mita
2006-04-26  7:39           ` Al Viro [this message]
2006-04-26  9:29             ` 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=20060426073944.GL27946@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mita@miraclelinux.com \
    --cc=nickpiggin@yahoo.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.