xfs
[Top] [All Lists]

Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation.

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 5/7] XFS: Make use of the init-once slab optimisation.
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 14 Aug 2008 15:00:01 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1218698083-11226-6-git-send-email-david@xxxxxxxxxxxxx>
References: <1218698083-11226-1-git-send-email-david@xxxxxxxxxxxxx> <1218698083-11226-6-git-send-email-david@xxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Aug 14, 2008 at 05:14:41PM +1000, Dave Chinner wrote:
> To avoid having to initialise some fields of the XFS inode
> on every allocation, we can use the slab init-once feature
> to initialise them. All we have to guarantee is that when
> we free the inode, all it's entries are in the initial state.
> Add asserts where possible to ensure debug kernels check this
> initial state before freeing and after allocation.

Looks good, and I think it this can be moved before the series and
submitted ASAP.

> diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c
> index cf6754a..4f4c939 100644
> --- a/fs/xfs/xfs_itable.c
> +++ b/fs/xfs/xfs_itable.c
> @@ -594,21 +594,21 @@ xfs_bulkstat(
>                                               /*
>                                                * Get the inode cluster buffer
>                                                */
> -                                             ASSERT(xfs_inode_zone != NULL);
> -                                             ip = 
> kmem_zone_zalloc(xfs_inode_zone,
> -                                                                   KM_SLEEP);
> -                                             ip->i_ino = ino;
> -                                             ip->i_mount = mp;
> -                                             
> spin_lock_init(&ip->i_flags_lock);
>                                               if (bp)
>                                                       xfs_buf_relse(bp);
> +                                             ip = xfs_inode_alloc(mp, ino);
> +                                             if (!ip) {
> +                                                     bp = NULL;
> +                                                     rval = ENOMEM;
> +                                                     break;
> +                                             }
>                                               error = xfs_itobp(mp, NULL, ip,
>                                                               &dip, &bp, bno,
>                                                               
> XFS_IMAP_BULKSTAT,
>                                                               XFS_BUF_LOCK);

Yikes, what a mess - eventually we should convert this to opencoded cals
to xfs_imap and xfs_imap_to_bp, but before the function needs to be
split into manageable chunk.  Another item on the todo list..


<Prev in Thread] Current Thread [Next in Thread>