From: Dipankar Sarma <dipankar@in.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Ravikiran G Thirumalai <kiran@in.ibm.com>,
akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] Add kref_read and kref_put_last primitives
Date: Tue, 3 Aug 2004 13:15:14 +0530 [thread overview]
Message-ID: <20040803074514.GA4432@in.ibm.com> (raw)
In-Reply-To: <20040803065130.GA10696@kroah.com>
On Mon, Aug 02, 2004 at 11:51:30PM -0700, Greg KH wrote:
> On Tue, Aug 03, 2004 at 11:12:18AM +0530, Dipankar Sarma wrote:
>
> > So, kref_read() as it is would look weird. But if we consider merging
> > the rest of the kref APIs (lock-free extensions) in future, then the
> > entire set including kref_read() would make sense.
>
> No, even with rcu versions, I don't see the need for this in the api.
I agree that RCU versions really doesn't need it. However, there
is code in many places in the kernel where we actually read
the actual reference count value and even compare it with
constants. Those things are problematic because you can't
use kref there without a kref_read_count() type API.
In typical driver object maintenance, this is not an issue
and rightly not exported.
> Sure, for this specific implementation of a atomic_t, it is useful, as
> the value is checked. But that means that you might just want to use an
> atomic_t, as it doesn't fit the model of a struct kref at all (something
> where you don't touch the reference count directly at all.)
Which prevents it from being used in many objects where we touch
the reference count directly. If we use atomic_t there, then we
need to abstract out inc/dec for RCU, which results in another
refcounter which you don't like (for good reasons, btw) ;-)
> Becides, I don't think that people are convinced that this code needs to
> be changed anyway :)
Which code ? If you are talking about the lock-free fd lookup
code, think POSIX threaded apps doing lots of I/O. tiobench
results show how useful it is.
Thanks
Dipankar
prev parent reply other threads:[~2004-08-03 7:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-26 14:48 [patch] Add kref_read and kref_put_last primitives Ravikiran G Thirumalai
2004-07-26 14:56 ` Ravikiran G Thirumalai
2004-07-26 16:31 ` Christoph Hellwig
2004-07-27 7:09 ` Ravikiran G Thirumalai
2004-07-27 9:43 ` Christoph Hellwig
2004-08-02 20:08 ` Greg KH
2004-08-03 5:42 ` Dipankar Sarma
2004-08-03 6:51 ` Greg KH
2004-08-03 7:45 ` Dipankar Sarma [this message]
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=20040803074514.GA4432@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=hch@infradead.org \
--cc=kiran@in.ibm.com \
--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