public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Nick Piggin <npiggin@kernel.dk>
Cc: linux-xfs@oss.sgi.com
Subject: Re: [PATCH 2/3] xfs: convert inode cache lookups to use RCU locking
Date: Wed, 15 Dec 2010 17:35:34 +1100	[thread overview]
Message-ID: <20101215063534.GF9925@dastard> (raw)
In-Reply-To: <loom.20101215T041848-135@post.gmane.org>

On Wed, Dec 15, 2010 at 03:30:43AM +0000, Nick Piggin wrote:
> In this case, if you can observe something that has happened after the
> inode is removed from the tree (ie. i_ino has changed), then you should
> not find it in the tree after a subsequent lookup (no synchronize_rcu
> required, just appropriate locking or barriers).

Ok, that's what I thought was supposed to be the case. Thanks
for confirming that, Nick.

> BTW. I wondered if you can also do the radix_tree tag lookup for reclaim
> under RCU?

It's currently under the ->pag_ici_lock using a
radix_tree_gang_lookup_tag, though I think this was a mismerge bug
from an earlier version.

I intended it to be under RCU as the "inode OK for reclaim"
validation checks won't touch an inode that already has XFS_IRECLAIM
already set (i.e. already under reclaim or freed), so the
reliability of tag lookups is not a big deal.

The lookup probably needs to check if XFS_IRECLAIMABLE is set
(rather than asserting it is set) to avoid so as to only reclaim
inodes that are really in the reclaimable state. Note that
->i_flags_lock controls all the state changes, so it should provide
the necessary item memory barriers to ensure that only reclaimable
inodes are found for reclaim.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-12-15  6:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13  1:32 [PATCH 0/2] xfs: RCU inode freeing and lookups V3 Dave Chinner
2010-12-13  1:32 ` [PATCH 1/3] xfs: rcu free inodes Dave Chinner
2010-12-14 20:23   ` Paul E. McKenney
2010-12-13  1:32 ` [PATCH 2/3] xfs: convert inode cache lookups to use RCU locking Dave Chinner
2010-12-14 21:18   ` Paul E. McKenney
2010-12-14 23:00     ` Dave Chinner
2010-12-15  1:05       ` Paul E. McKenney
2010-12-15  2:50         ` Dave Chinner
2010-12-15  6:34           ` Paul E. McKenney
2010-12-15  3:30         ` Nick Piggin
2010-12-15  6:35           ` Dave Chinner [this message]
2010-12-15  8:05             ` Nick Piggin
2010-12-13  1:32 ` [PATCH 3/3] xfs: convert pag_ici_lock to a spin lock Dave Chinner
2010-12-14 21:19   ` Paul E. McKenney

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=20101215063534.GF9925@dastard \
    --to=david@fromorbit.com \
    --cc=linux-xfs@oss.sgi.com \
    --cc=npiggin@kernel.dk \
    /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