public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Akinobu Mita <mita@miraclelinux.com>
To: Greg KH <greg@kroah.com>
Cc: Jens Axboe <axboe@suse.de>, Al Viro <viro@ftp.linux.org.uk>,
	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 15:20:30 +0800	[thread overview]
Message-ID: <20060426072030.GA7693@miraclelinux.com> (raw)
In-Reply-To: <20060426051813.GB332@kroah.com>

On Tue, Apr 25, 2006 at 10:18:13PM -0700, Greg KH wrote:
> > > Let's _not_.  It's extra overhead for no good reason.
> > 
> > Completely agree. That goes for the other block layer kref patches as
> > well.
> 
> I also agree, there's a reason I never tried to convert them in the past
> :)

kref has faster function for decrement refcount.

kref_put()
{
...

	/*
	 * if current count is one, we are the last user and can release object
	 * right now, avoiding an atomic operation on 'refcount'
	 */
	if ((atomic_read(&kref->refcount) == 1) ||
		(atomic_dec_and_test(&kref->refcount))) {
		release(kref);
		return 1;
	}

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?


  reply	other threads:[~2006-04-26  7:20 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 [this message]
2006-04-26  7:39           ` Al Viro
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=20060426072030.GA7693@miraclelinux.com \
    --to=mita@miraclelinux.com \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=viro@ftp.linux.org.uk \
    /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