From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Dave Chinner <david@fromorbit.com>
Cc: eric.dumazet@gmail.com, xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] xfs: rcu free inodes
Date: Tue, 14 Dec 2010 12:23:01 -0800 [thread overview]
Message-ID: <20101214202301.GG2161@linux.vnet.ibm.com> (raw)
In-Reply-To: <1292203957-15819-2-git-send-email-david@fromorbit.com>
On Mon, Dec 13, 2010 at 12:32:35PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> Introduce RCU freeing of XFS inodes so that we can convert lookup
> traversals to use rcu_read_lock() protection. This patch only
> introduces the RCU freeing to minimise the potential conflicts with
> mainline if this is merged into mainline via a VFS patchset. It
> abuses the i_dentry list for the RCU callback structure because the
> VFS patches make this a union so it is safe to use like this and
> simplifies and merge issues.
>
> This patch uses basic RCU freeing rather than SLAB_DESTROY_BY_RCU.
> The later lookup patches need the same "found free inode" protection
> regardless of the RCU freeing method used, so once again the RCU
> freeing method can be dealt with apprpriately at merge time without
> affecting any other code.
There are only two call sites that free into xfs_inode_zone. One of them
is initialization, before readers have access to the data strcuture,
and the other is covered by this patch. So looks good to me!
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/xfs_iget.c | 14 +++++++++++++-
> 1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
> index cdb1c25..9fae475 100644
> --- a/fs/xfs/xfs_iget.c
> +++ b/fs/xfs/xfs_iget.c
> @@ -105,6 +105,18 @@ xfs_inode_alloc(
> }
>
> void
> +__xfs_inode_free(
> + struct rcu_head *head)
> +{
> + struct inode *inode = container_of((void *)head,
> + struct inode, i_dentry);
> + struct xfs_inode *ip = XFS_I(inode);
> +
> + INIT_LIST_HEAD(&inode->i_dentry);
> + kmem_zone_free(xfs_inode_zone, ip);
> +}
> +
> +void
> xfs_inode_free(
> struct xfs_inode *ip)
> {
> @@ -147,7 +159,7 @@ xfs_inode_free(
> ASSERT(!spin_is_locked(&ip->i_flags_lock));
> ASSERT(completion_done(&ip->i_flush));
>
> - kmem_zone_free(xfs_inode_zone, ip);
> + call_rcu((struct rcu_head *)&VFS_I(ip)->i_dentry, __xfs_inode_free);
> }
>
> /*
> --
> 1.7.2.3
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-12-14 20:21 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 [this message]
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
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=20101214202301.GG2161@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=david@fromorbit.com \
--cc=eric.dumazet@gmail.com \
--cc=xfs@oss.sgi.com \
/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