Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 19:39:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M3cpV3031468 for ; Mon, 21 Jan 2008 19:39:02 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA24866; Tue, 22 Jan 2008 14:38:47 +1100 Message-ID: <47956615.90700@sgi.com> Date: Tue, 22 Jan 2008 14:42:13 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] reduce log I/O latency V2 References: <20080121041649.GA155259@sgi.com> In-Reply-To: <20080121041649.GA155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14244 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Looks good Dave. Shouldn't we also tag the second buffer in the split log write case? David Chinner wrote: > Reduce log I/O latency > > To ensure that log I/O is issued as the highest priority I/O, set > the I/O priority of the log I/O to the highest possible. This will > ensure that log I/O is not held up behind bulk data or other > metadata I/O as delaying log I/O can pause the entire transaction > subsystem. Introduce a new buffer flag to allow us to tag the log > buffers so we can discriminate when issuing the I/O. > > Version 2: > - don't use realtime priority class > > Signed-off-by: Dave Chinner > --- > fs/xfs/linux-2.6/xfs_buf.c | 3 +++ > fs/xfs/linux-2.6/xfs_buf.h | 5 ++++- > fs/xfs/xfs_log.c | 2 ++ > 3 files changed, 9 insertions(+), 1 deletion(-) > > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 01:39:42.286538135 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 > @@ -1198,6 +1198,9 @@ next_chunk: > > submit_io: > if (likely(bio->bi_size)) { > + /* log I/O should not be delayed by anything except realtime. */ > + if (bp->b_flags & XBF_LOG_BUFFER) > + bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); > submit_bio(rw, bio); > if (size) > goto next_chunk; > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 01:11:16.871181483 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 11:55:09.642183801 +1100 > @@ -53,7 +53,8 @@ typedef enum { > XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ > XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ > XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ > - XBF_ORDERED = (1 << 11), /* use ordered writes */ > + XBF_LOG_BUFFER = (1 << 9), /* Buffer issued by the log */ > + XBF_ORDERED = (1 << 11), /* use ordered writes */ > XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ > > /* flags used only as arguments to access routines */ > @@ -339,6 +340,8 @@ extern void xfs_buf_trace(xfs_buf_t *, c > #define XFS_BUF_TARGET(bp) ((bp)->b_target) > #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) > > +#define XFS_BUF_SET_LOGBUF(bp) ((bp)->b_flags |= XBF_LOG_BUFFER) > + > static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) > { > bp->b_fspriv3 = mp; > Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2007-12-19 01:11:16.871181483 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2007-12-19 11:55:09.698176566 +1100 > @@ -1443,6 +1443,8 @@ xlog_sync(xlog_t *log, > XFS_BUF_ZEROFLAGS(bp); > XFS_BUF_BUSY(bp); > XFS_BUF_ASYNC(bp); > + XFS_BUF_SET_LOGBUF(bp); > + > /* > * Do an ordered write for the log block. > * Its unnecessary to flush the first split block in the log wrap case. >