[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-24
Subject:    [XFS] Be explicit in adding in the non-transactional data to the
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2004-03-31 22:51:05
Message-ID: 200404021303.i32D36c5001744 () hera ! kernel ! org
[Download RAW message or body]

ChangeSet 1.1302.56.12, 2004/04/01 08:51:05+10:00, tes@sgi.com

	[XFS] Be explicit in adding in the non-transactional data to the
	reservation estimate.  We must add in for the worst case of a log
	stripe taking us the full distance for a log stripe boundary.
	
	SGI Modid: xfs-linux:xfs-kern:169304a


# This patch includes the following deltas:
#	           ChangeSet	1.1302.56.11 -> 1.1302.56.12
#	fs/xfs/xfs_log_priv.h	1.32    -> 1.33   
#	    fs/xfs/xfs_log.c	1.82    -> 1.83   
#	 fs/xfs/xfs_macros.c	1.21    -> 1.22   
#

 xfs_log.c      |   36 +++++++++++++++++++++++-------------
 xfs_log_priv.h |    7 +------
 xfs_macros.c   |    8 --------
 3 files changed, 24 insertions(+), 27 deletions(-)


diff -Nru a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
--- a/fs/xfs/xfs_log.c	Fri Apr  2 05:03:08 2004
+++ b/fs/xfs/xfs_log.c	Fri Apr  2 05:03:08 2004
@@ -3160,6 +3160,7 @@
 		uint		xflags)
 {
 	xlog_ticket_t	*tic;
+	uint		num_headers;
 	SPLDECL(s);
 
  alloc:
@@ -3183,21 +3184,30 @@
 	 * in the log.  A unit in this case is the amount of space for one
 	 * of these log operations.  Normal reservations have a cnt of 1
 	 * and their unit amount is the total amount of space required.
-	 * The following line of code adds one log record header length
-	 * for each part of an operation which may fall on a different
-	 * log record.
 	 *
-	 * One more XLOG_HEADER_SIZE is added to account for possible
-	 * round off errors when syncing a LR to disk.  The bytes are
-	 * subtracted if the thread using this ticket is the first writer
-	 * to a new LR.
-	 *
-	 * We add an extra log header for the possibility that the commit
-	 * record is the first data written to a new log record.  In this
-	 * case it is separate from the rest of the transaction data and
-	 * will be charged for the log record header.
+	 * The following lines of code account for non-transaction data
+	 * which occupy space in the on-disk log. 
 	 */
-	unit_bytes += log->l_iclog_hsize * (XLOG_BTOLRBB(unit_bytes) + 2);
+
+	/* for start-rec */
+	unit_bytes += sizeof(xlog_op_header_t); 
+
+	/* for padding */
+	if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) &&
+		log->l_mp->m_sb.sb_logsunit > 1) {
+		/* log su roundoff */
+		unit_bytes += log->l_mp->m_sb.sb_logsunit;  
+	} else {
+		/* BB roundoff */
+		unit_bytes += BBSIZE;
+        }
+
+	/* for commit-rec */
+	unit_bytes += sizeof(xlog_op_header_t);
+ 
+	/* for LR headers */
+	num_headers = ((unit_bytes + log->l_iclog_size-1) >> log->l_iclog_size_log);
+	unit_bytes += log->l_iclog_hsize * num_headers;
 
 	tic->t_unit_res		= unit_bytes;
 	tic->t_curr_res		= unit_bytes;
diff -Nru a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
--- a/fs/xfs/xfs_log_priv.h	Fri Apr  2 05:03:08 2004
+++ b/fs/xfs/xfs_log_priv.h	Fri Apr  2 05:03:08 2004
@@ -57,12 +57,6 @@
 #define XLOG_RECORD_BSHIFT	14		/* 16384 == 1 << 14 */
 #define XLOG_BIG_RECORD_BSHIFT	15		/* 32k == 1 << 15 */
 #define XLOG_MAX_RECORD_BSHIFT	18		/* 256k == 1 << 18 */
-#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XLOG_BTOLRBB)
-int xlog_btolrbb(int b);
-#define XLOG_BTOLRBB(b)		xlog_btolrbb(b)
-#else
-#define XLOG_BTOLRBB(b)		(((b)+XLOG_RECORD_BSIZE-1) >> XLOG_RECORD_BSHIFT)
-#endif
 #define XLOG_BTOLSUNIT(log, b)  (((b)+(log)->l_mp->m_sb.sb_logsunit-1) / \
                                  (log)->l_mp->m_sb.sb_logsunit)
 #define XLOG_LSUNITTOB(log, su) ((su) * (log)->l_mp->m_sb.sb_logsunit)
@@ -560,6 +554,7 @@
 extern int	 xlog_bread(xlog_t *, xfs_daddr_t, int, struct xfs_buf *);
 extern xfs_caddr_t xlog_align(xlog_t *, xfs_daddr_t, int, struct xfs_buf *);
 
+/* iclog tracing */
 #define XLOG_TRACE_GRAB_FLUSH  1
 #define XLOG_TRACE_REL_FLUSH   2
 #define XLOG_TRACE_SLEEP_FLUSH 3
diff -Nru a/fs/xfs/xfs_macros.c b/fs/xfs/xfs_macros.c
--- a/fs/xfs/xfs_macros.c	Fri Apr  2 05:03:08 2004
+++ b/fs/xfs/xfs_macros.c	Fri Apr  2 05:03:08 2004
@@ -2219,14 +2219,6 @@
 }
 #endif
 
-#if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_BTOLRBB)
-int
-xlog_btolrbb(int b)
-{
-	return XLOG_BTOLRBB(b);
-}
-#endif
-
 #if XFS_WANT_FUNCS_C || (XFS_WANT_SPACE_C && XFSSO_XLOG_GRANT_ADD_SPACE)
 void
 xlog_grant_add_space(xlog_t *log, int bytes, int type)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic