From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org, Hugh Dickins <hugh@veritas.com>,
Jens Axboe <axboe@suse.de>, Ingo Molnar <mingo@elte.hu>,
Dave Miller <davem@redhat.com>
Subject: Re: Move struct file RCU handling into the slab allocator?
Date: Thu, 22 Jun 2006 07:27:10 -0700 [thread overview]
Message-ID: <20060622142710.GB1295@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0606211517160.22515@schroedinger.engr.sgi.com>
On Wed, Jun 21, 2006 at 03:36:10PM -0700, Christoph Lameter wrote:
> On Sat, 17 Jun 2006, Paul E. McKenney wrote:
>
> > Careful performance testing is needed as well, the validity check does
> > appear to me to be pretty lightweight, but this stuff is a bit sensitive
> > to performance.
>
> Jens has done some testing with another approach like this and found a
> good increase in speed.
And I would be much more concerned if the change was in the single-threaded
fastpath in fget_light(), to be sure. But getting a view of multi-threaded
performance of this particular patch for a variety of workloads is still
warranted.
> > Some one less than a philistine than I might argue that this should
> > go back to the original name of f_list. ;-)
>
> Did that in V2 of the patch.
Cool!
> > o Not sure whether hfs_file_release()s check for zero f_count
> > still works, but am quite concerned. HFS experts?
> >
> > o Ditto for hfsplus_file_release(). And for affs_file_release().
>
> That is not a problem since the object has not been returned to the slab
> yet so it cannot have been reused.
Good enough!
Thanx, Paul
> A problem could occur if one could
> now establish a new reference to the object while it has a zero count.
> But if that would be possible then we would be already in trouble.
>
> The RCU check is only used to guarantee that the object is not
> vanishing from under us while we increase the refcount if it was not
> zero. Since it is zero in these cases that will never occur.
>
> In order to generate a wrong alias situation the following needs to
> happen:
>
> process 1 process 2:
>
> do table lookup
> free the filp structure (refcount becomes zero)
> modify table
> create a new filp structure (same address)
> increment counter to 1
> inc_if_nonzero
> (counter becomes two)
>
> <now we have a wrong reference>
>
> put_filp (reduce refcount)
>
> Table lookup fails->fget fails.
>
>
prev parent reply other threads:[~2006-06-22 14:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-16 19:48 Christoph Lameter
2006-06-17 21:37 ` Paul E. McKenney
2006-06-21 22:36 ` Christoph Lameter
2006-06-22 14:27 ` Paul E. McKenney [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=20060622142710.GB1295@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=axboe@suse.de \
--cc=clameter@sgi.com \
--cc=davem@redhat.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®