xfs
[Top] [All Lists]

Re: [PATCH 1/7] xfs: split inode data writeback from xfs_sync_inodes_ag

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/7] xfs: split inode data writeback from xfs_sync_inodes_ag
From: Sujit Karataparambil <sjt.kar@xxxxxxxxx>
Date: Fri, 15 May 2009 10:19:11 +0530
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=DzSiFlCcNuCzOfmH2EFZeuSK/gBYkR8DlYO0yinWJG0=; b=xLKlbcH4kd6T88tkZEtoRT7ZrCIqiohffi2GLixUWGBBAkIUJnHkT500HlmoNtyM8o Q/AyGbBOg20qsbJAj17kZZotyuPSI0mWhU4K94iqgK57QUM8R7xr1pEGFJOpdbpsXM/r l9a7+tmVo8ONHQ1wRNJIJyF3ObQRX+agxtljQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=QANB1tPdpLcJ28IwzL++fYrCTBr9QR8MfyjTR1A9p0Twi0N9kMHXkr4sfFRjKCd2Fl m0INkkLCfWDGaNBS713Iwmaq4V3EQ1RIAjaXOuV03wwZsin+FM1ZS0/bjybKqumdKjkQ WHaIR5JECi3/gFMU3AAVAXWh88atrK9T7CFIE=
In-reply-to: <20090514171558.014747000@xxxxxxxxxxxxxxxxxxxxxx>
References: <20090514171233.942489000@xxxxxxxxxxxxxxxxxxxxxx> <20090514171558.014747000@xxxxxxxxxxxxxxxxxxxxxx>
> +STATIC int
> +xfs_sync_inode_data(
> +       struct xfs_inode        *ip,
> +       int                     flags)
> +{
> +       struct inode    *inode = VFS_I(ip);
> +       struct address_space *mapping = inode->i_mapping;
> +       int             error = 0;
> +
> +       if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
> +               if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) {
> +                       if (flags & SYNC_TRYLOCK)
> +                               goto out_wait;
> +                       xfs_ilock(ip, XFS_IOLOCK_SHARED);
> +               }
> +
> +               error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ?
> +                                       0 : XFS_B_ASYNC, FI_NONE);
> +               xfs_iunlock(ip, XFS_IOLOCK_SHARED);
> +       }
> +
> + out_wait:
> +       if (flags & SYNC_IOWAIT)
> +               xfs_ioend_wait(ip);
> +       return error;
> +}
> +
 should not there be an.

 error = xfs_flush_pages(ip, 0, -1, (flags & SYNC_WAIT) ?
                       0 : XFS_B_ASYNC, FI_NONE);

for the out_wait. This will ensure flush while the xfs_ioend_wait is being
waited for. Would this be an better way to flush the data than waiting for
the inode to be flushed during power off or scheduler cycles.
Would this be an performance hit.

or better use

  error = xfs_sync_inode_data(ip, flags);


-- 
-- Sujit K M

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